Enode — API Reference
    Preparing search index...

    Type Alias SingleFlightOptions

    type SingleFlightOptions = {
        lockoutMs?: number;
        now?: () => number;
        onBusyChange?: (busy: boolean) => void;
    }
    Index

    Properties

    lockoutMs?: number

    Suppression window in ms after a run settles (for async handlers) or after the call (for sync handlers). Defaults to SINGLE_FLIGHT_LOCKOUT_MS.

    now?: () => number

    Clock override for tests. Defaults to performance.now.

    onBusyChange?: (busy: boolean) => void

    Called with true when a run starts awaiting a promise and false once it settles. Never called for synchronous handlers — an instant action shouldn't flash a busy/disabled style.