apollo-state-sync - API Reference (Users)
    Preparing search index...

    Variable synchronizationDebouncerConst

    synchronizationDebouncer: SynchronizationDebouncer = ...

    Debounces state synchronization to optimize UI rendering and network performance.

    Purpose: Group broadcasts belonging to the same UI rendering chain together. This prevents race conditions, redundant network requests, and invalid Apollo Client state.

    How it works:

    1. Track In-Flight GraphQL Requests: Broadcasting while requests are in-flight can corrupt Apollo Client state or trigger duplicate requests. We actively track the count of active network requests.
    2. Account for UI Rendering: UI components usually rerender immediately after receiving a GraphQL response. Broadcasting during this render phase causes similar state invalidation.
    3. Debounce Post-Request: Once all in-flight requests drop to zero, we wait for globalConfig.synchronizationDebounceTimeoutMs to ensure the UI has completely finished its rendering cycle before safely executing the broadcast.