@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
19 lines • 875 B
TypeScript
export type SyncPhase = "syncing" | "synced" | "failed";
/**
* After `isSyncSettled` becomes true while leaving a syncing cycle, wait this
* long before committing the phase. If `isSyncSettled` bounces back to false
* during this window (sub-account discovery, retry, etc.), the timer resets.
* This prevents the syncing → synced → failed flash.
*/
export declare const SYNC_SETTLE_GUARD_MS = 3000;
/**
* FSM driving the TopBar indicator and balance shimmer.
*
* Phases: syncing -> synced | failed.
*
* SYNC_BEGIN fires on cold start / manual refresh.
* SYNC_COMPLETE fires on settle, deferred by SYNC_SETTLE_GUARD_MS
* when leaving syncing to absorb bouncing settle states.
*/
export declare function useSyncLifecycle(isBalanceLoading: boolean, stableSyncPending: boolean, hasAnySyncError: boolean): SyncPhase;
//# sourceMappingURL=useSyncLifecycle.d.ts.map