import { inject } from 'aurelia-framework' ; import { valueOf } from '../firebase' ; import { User } from '../models' ; import Reference = firebase . database . Reference ; export class UserRepository { private readonly users : Reference ; constructor ( @ inject ( 'database' ) database ) { this . users = database . child ( 'user' ) ; } async findById ( id ) { return valueOf ( this . users . child ( id . toString ( ) ) ) ; } }