Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return false;
}
const { path, eventType, once } = this._reverseLookup[registration];
if (!this._tree[path]) {
delete this._reverseLookup[registration];
return false;
}
if (!this._tree[path][eventType]) {
delete this._reverseLookup[registration];
return false;
}
// we don't want `once` events to notify native as they're already
// automatically unsubscribed on native when the first event is sent
const registrationObj = this._reverseLookup[registration];
if (registrationObj && !once) {
NativeModulesProxy.ExpoFirebaseDatabase.off(registrationObj.key, registration);
}
delete this._tree[path][eventType][registration];
delete this._reverseLookup[registration];
return !!registrationObj;
}
/**
if (!this._tree[path]) {
delete this._reverseLookup[registration];
return false;
}
if (!this._tree[path][eventType]) {
delete this._reverseLookup[registration];
return false;
}
// we don't want `once` events to notify native as they're already
// automatically unsubscribed on native when the first event is sent
const registrationObj = this._reverseLookup[registration];
if (registrationObj && !once) {
NativeModulesProxy.ExpoFirebaseDatabase.off(registrationObj.key, registration);
}
delete this._tree[path][eventType][registration];
delete this._reverseLookup[registration];
return !!registrationObj;
}
constructor() {
this._tree = {};
this._reverseLookup = {};
if (NativeModulesProxy.ExpoFirebaseDatabase) {
this._nativeEmitter = new EventEmitter(NativeModulesProxy.ExpoFirebaseDatabase);
this._nativeEmitter.addListener('Expo.Firebase.database_sync_event', this._handleSyncEvent.bind(this));
}
}
/**
constructor() {
this._tree = {};
this._reverseLookup = {};
if (NativeModulesProxy.ExpoFirebaseDatabase) {
this._nativeEmitter = new EventEmitter(NativeModulesProxy.ExpoFirebaseDatabase);
this._nativeEmitter.addListener('Expo.Firebase.database_sync_event', this._handleSyncEvent.bind(this));
}
}
/**
constructor() {
this._tree = {};
this._reverseLookup = {};
if (NativeModulesProxy.ExpoFirebaseDatabase) {
this._nativeEmitter = new EventEmitter(NativeModulesProxy.ExpoFirebaseDatabase);
this._nativeEmitter.addListener(
'Expo.Firebase.database_sync_event',
this._handleSyncEvent.bind(this)
);
}
}
constructor() {
this._tree = {};
this._reverseLookup = {};
if (NativeModulesProxy.ExpoFirebaseDatabase) {
this._nativeEmitter = new EventEmitter(NativeModulesProxy.ExpoFirebaseDatabase);
this._nativeEmitter.addListener(
'Expo.Firebase.database_sync_event',
this._handleSyncEvent.bind(this)
);
}
}