Arc.React
    Preparing search index...

    Function useChangeStream

    • React hook that subscribes to an observable query and exposes per-update change deltas (added, replaced, removed items) as React state rather than the full collection snapshot.

      The hook uses the same underlying subscription and caching infrastructure as useObservableQuery — no additional server connections are opened.

      Type Parameters

      • TDataType

        The element type of the observable collection.

      • TQuery extends IChangeStreamFor<TDataType>

        The observable query class (must implement IChangeStreamFor).

      • TArguments = object

        Optional query arguments type.

      Parameters

      • query: Constructor<TQuery>

        The observable query constructor.

      • Optionalargs: TArguments

        Optional query arguments.

      • OptionalgetKey: (item: TDataType) => unknown

        Optional function that returns a stable identity key for an item. When provided, items with the same key but different content are reported as {@code replaced}. Without it, only additions and removals are detected.

      • Optionalsorting: any

        Optional sorting configuration.

      • isEnabled: boolean = true

        When false the hook is a no-op. Defaults to true.

      Returns ChangeSet<TDataType>

      The latest ChangeSet describing what changed in the most recent update.