import { EMPTY_FIREBASE_CONFIG , FirebaseServiceFactory } from "@counterfactual/firebase-client" ; import FirebaseServer from "firebase-server" ; /**
 * This wraps the FirebaseServiceFactory while providing a Firebase Server
 * for the client to connect to.
 */ export class LocalFirebaseServiceFactory extends FirebaseServiceFactory { firebaseServer : FirebaseServer ; constructor ( private readonly host , private readonly port ) { super ( { ... EMPTY_FIREBASE_CONFIG , databaseURL : `ws://${ host }:${ port }` } ) ; this . firebaseServer = new FirebaseServer ( this . port , this . host ) ; } async closeServiceConnections ( ) { await this . firebaseServer . close ( ) ; } }