firefly-limiter - v1.0.1
    Preparing search index...

    Interface CallOptions<T>

    The parts of a call that belong to the call rather than to the dependency.

    Everything else about calling this thing was decided once, in DependencyOptions. These two could not be: coalescing needs something to coalesce on, and a substitute result has the type of whatever this one call returns.

    interface CallOptions<T> {
        fallback?: (error: unknown) => T | Promise<T>;
        share?: string;
        signal?: AbortSignal;
    }

    Type Parameters

    • T
    Index
    fallback?: (error: unknown) => T | Promise<T>

    What to answer with when the call has failed all the way through: stale data, an empty list, a degraded result. The handler is given the failure, and throwing from it is how you decline to answer for that one.

    share?: string

    Collapses this call into any other call to the same dependency running under the same key, so twenty callers wanting one thing make one request and share its attempts. See SingleFlight for what leaving early does to the call the others are still waiting on.

    signal?: AbortSignal

    Abandons this call.