Ditto JS SDK v5.2.0
    Preparing search index...

    Type Alias StoreObservationHandlerWithSignalNext<T>

    StoreObservationHandlerWithSignalNext: (
        queryResult: QueryResult<T>,
        signalNext: () => any,
    ) => void

    A store observation handler is called whenever an active store observer receives new results.

    Call signalNext() to signal that the handler is ready to receive the next callback from the store observer. This is a mechanism for handling backpressure when updates arrive faster than the handler can process them. Until signalNext() is called, Ditto pauses further callbacks while continuing to apply changes to the local store. If multiple relevant changes occur while callbacks are paused, Ditto does not queue a callback for each change. After signalNext() is called, Ditto invokes the handler at most once with the latest result, and only if that result differs from the last result delivered.

    Type Parameters

    • T = any

      The type of items in the query result.

    Type Declaration

      • (queryResult: QueryResult<T>, signalNext: () => any): void
      • Parameters

        Returns void