React Native Firebase
    Preparing search index...
    • Listens for data changes at a particular location.

      This is the primary way to read data from a Database. Your callback will be triggered for the initial data and again whenever the data changes. Invoke the returned unsubscribe callback to stop receiving updates.

      An onChildChanged event will be triggered when the data stored in a child (or any of its descendants) changes. Note that a single child_changed event may represent multiple changes to the child. The DataSnapshot passed to the callback will contain the new child contents. For ordering purposes, the callback is also passed a second argument which is a string containing the key of the previous sibling child by sort order, or null if it is the first child.

      Parameters

      • query: FirebaseDatabaseTypes.Query

        The query to run.

      • callback: (
            snapshot: FirebaseDatabaseTypes.DataSnapshot,
            previousChildName: string | null,
        ) => unknown

        A callback that fires when the specified event occurs. The callback will be passed a DataSnapshot and a string containing the key of the previous child, by sort order, or null if it is the first child.

      • OptionalcancelCallback: (error: Error) => unknown

        An optional callback that will be notified if your event subscription is ever canceled because your client does not have permission to read this data (or it had permission but has now lost it). This callback will be passed an Error object indicating why the failure occurred.

      Returns Unsubscribe

      A function that can be invoked to remove the listener.

    • Listens for data changes at a particular location.

      This is the primary way to read data from a Database. Your callback will be triggered for the initial data and again whenever the data changes. Invoke the returned unsubscribe callback to stop receiving updates.

      An onChildChanged event will be triggered when the data stored in a child (or any of its descendants) changes. Note that a single child_changed event may represent multiple changes to the child. The DataSnapshot passed to the callback will contain the new child contents. For ordering purposes, the callback is also passed a second argument which is a string containing the key of the previous sibling child by sort order, or null if it is the first child.

      Parameters

      • query: FirebaseDatabaseTypes.Query

        The query to run.

      • callback: (
            snapshot: FirebaseDatabaseTypes.DataSnapshot,
            previousChildName: string | null,
        ) => unknown

        A callback that fires when the specified event occurs. The callback will be passed a DataSnapshot and a string containing the key of the previous child, by sort order, or null if it is the first child.

      • options: ListenOptions

        An object that can be used to configure onlyOnce, which then removes the listener after its first invocation.

      Returns Unsubscribe

      A function that can be invoked to remove the listener.

    • Listens for data changes at a particular location.

      This is the primary way to read data from a Database. Your callback will be triggered for the initial data and again whenever the data changes. Invoke the returned unsubscribe callback to stop receiving updates.

      An onChildChanged event will be triggered when the data stored in a child (or any of its descendants) changes. Note that a single child_changed event may represent multiple changes to the child. The DataSnapshot passed to the callback will contain the new child contents. For ordering purposes, the callback is also passed a second argument which is a string containing the key of the previous sibling child by sort order, or null if it is the first child.

      Parameters

      • query: FirebaseDatabaseTypes.Query

        The query to run.

      • callback: (
            snapshot: FirebaseDatabaseTypes.DataSnapshot,
            previousChildName: string | null,
        ) => unknown

        A callback that fires when the specified event occurs. The callback will be passed a DataSnapshot and a string containing the key of the previous child, by sort order, or null if it is the first child.

      • cancelCallback: (error: Error) => unknown

        An optional callback that will be notified if your event subscription is ever canceled because your client does not have permission to read this data (or it had permission but has now lost it). This callback will be passed an Error object indicating why the failure occurred.

      • options: ListenOptions

        An object that can be used to configure onlyOnce, which then removes the listener after its first invocation.

      Returns Unsubscribe

      A function that can be invoked to remove the listener.

    • Listens for data changes at a particular location.

      This is the primary way to read data from a Database. Your callback will be triggered for the initial data and again whenever the data changes. Invoke the returned unsubscribe callback to stop receiving updates.

      An onChildChanged event will be triggered when the data stored in a child (or any of its descendants) changes. Note that a single child_changed event may represent multiple changes to the child. The DataSnapshot passed to the callback will contain the new child contents. For ordering purposes, the callback is also passed a second argument which is a string containing the key of the previous sibling child by sort order, or null if it is the first child.

      Parameters

      • query: FirebaseDatabaseTypes.Query

        The query to run.

      • callback: (
            snapshot: FirebaseDatabaseTypes.DataSnapshot,
            previousChildName: string | null,
        ) => unknown

        A callback that fires when the specified event occurs. The callback will be passed a DataSnapshot and a string containing the key of the previous child, by sort order, or null if it is the first child.

      • OptionalcancelCallbackOrListenOptions: ListenOptions | ((error: Error) => unknown)
      • Optionaloptions: ListenOptions

      Returns Unsubscribe

      A function that can be invoked to remove the listener.