How to use the @unimodules/core.NativeModulesProxy.ExpoFirebaseDatabase function in @unimodules/core

To help you get started, we’ve selected a few @unimodules/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github expo / expo / packages / expo-firebase-database / build / SyncTree.js View on Github external
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;
    }
    /**
github expo / expo / packages / expo-firebase-database / src / SyncTree.ts View on Github external
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;
  }
github expo / expo / packages / expo-firebase-database / build / SyncTree.js View on Github external
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));
        }
    }
    /**
github expo / expo / packages / expo-firebase-database / build / SyncTree.js View on Github external
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));
        }
    }
    /**
github expo / expo / packages / expo-firebase-database / src / SyncTree.ts View on Github external
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)
      );
    }
  }
github expo / expo / packages / expo-firebase-database / src / SyncTree.ts View on Github external
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)
      );
    }
  }