How to use the @react-native-firebase/app/lib/common.pathChild function in @react-native-firebase/app

To help you get started, we’ve selected a few @react-native-firebase/app 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 invertase / react-native-firebase / packages / database / lib / DatabaseReference.js View on Github external
this._database,
        pathChild(this.path, id),
        Promise.resolve(this.child(id)),
      );
    }

    const pushRef = this.child(id);

    const promise = pushRef.set(value, onComplete).then(() => pushRef);

    // Prevent unhandled promise rejection if onComplete is passed
    if (onComplete) {
      promise.catch(() => {});
    }

    return new DatabaseThenableReference(this._database, pathChild(this.path, id), promise);
  }
github invertase / react-native-firebase / packages / database / lib / DatabaseReference.js View on Github external
push(value, onComplete) {
    if (!isUndefined(onComplete) && !isFunction(onComplete)) {
      throw new Error(
        "firebase.database().ref().push(_, *) 'onComplete' must be a function if provided.",
      );
    }

    const id = generateDatabaseId(this._database._serverTimeOffset);

    if (isUndefined(value) || isNull(value)) {
      return new DatabaseThenableReference(
        this._database,
        pathChild(this.path, id),
        Promise.resolve(this.child(id)),
      );
    }

    const pushRef = this.child(id);

    const promise = pushRef.set(value, onComplete).then(() => pushRef);

    // Prevent unhandled promise rejection if onComplete is passed
    if (onComplete) {
      promise.catch(() => {});
    }

    return new DatabaseThenableReference(this._database, pathChild(this.path, id), promise);
  }
github invertase / react-native-firebase / packages / database / lib / DatabaseReference.js View on Github external
child(path) {
    if (!isString(path)) {
      throw new Error("firebase.database().ref().child(*) 'path' must be a string value.");
    }
    return new DatabaseReference(this._database, pathChild(this.path, path));
  }
github invertase / react-native-firebase / packages / storage / lib / StorageReference.js View on Github external
child(path) {
    const childPath = pathChild(this.path, path);
    return new StorageReference(this._storage, childPath);
  }

@react-native-firebase/app

A well tested, feature rich Firebase implementation for React Native, supporting iOS & Android. Individual module support for Admob, Analytics, Auth, Crash Reporting, Cloud Firestore, Database, Dynamic Links, Functions, Messaging (FCM), Remote Config, Sto

Apache-2.0
Latest version published 1 day ago

Package Health Score

98 / 100
Full package analysis