pure
    Preparing search index...

    Type Alias BatchConstructor<TFn>

    Options to construct a batch function

    type BatchConstructor<TFn extends AnyFn> = {
        batch: (args: Parameters<TFn>[]) => Parameters<TFn>;
        disregardExecutionTime?: boolean;
        fn: TFn;
        interval: number;
        unbatch?: (
            inputs: Parameters<TFn>[],
            output: AwaitRet<TFn>,
        ) => AwaitRet<TFn>[];
    }

    Type Parameters

    Index

    Properties

    batch: (args: Parameters<TFn>[]) => Parameters<TFn>

    Function to batch the inputs across multiple calls

    disregardExecutionTime?: boolean

    See debounce for more information

    fn: TFn

    Function to be wrapped

    interval: number

    Interval between each batched call

    unbatch?: (inputs: Parameters<TFn>[], output: AwaitRet<TFn>) => AwaitRet<TFn>[]

    If provided, unbatch the output according to the inputs, so each call receives its own output.

    By default, each input will receive the same output from the batched call