import { Firebase , RNFirebase } from '@ulangi/react-native-firebase' ; export class FirebaseAdapter { private firebase : Firebase ; public constructor ( firebase ) { this . firebase = firebase ; } public signInWithCustomToken ( firebaseToken ) { return this . firebase . auth ( ) . signInWithCustomToken ( firebaseToken ) ; } public signOut ( ) { return this . firebase . auth ( ) . signOut ( ) ; } public addListener ( path , callback , errorCallback ) { return this . firebase . database ( ) . ref ( path ) . on ( 'value' , callback , errorCallback ) ; } public removeListener ( path , callback ) { return this . firebase . database ( ) . ref ( path ) . off ( 'value' , callback ) ; } public removeListeners ( pathListenerPairs ) { pathListenerPairs . forEach ( ( [ path , listener ] ) : void => { this . removeListener ( path , listener ) ; } ) ; } }