Function onSnapshot

  • Adds a reaction that will trigger every time an snapshot changes.

    Type Parameters

    • T extends object

    Parameters

    • nodeOrFn: T | (() => T)

      Object to get the snapshot from or a function to get it.

    • listener: OnSnapshotListener<T>

      Function that will be triggered when the snapshot changes.

    Returns OnSnapshotDisposer

    A disposer.

    Typeparam

    T Object type.