ixfx
    Preparing search index...

    Type Alias LazyChain<In, Out>

    LazyChain: {
        asArray: (data?: GenOrData<In>) => Promise<Out[]>;
        asAsync: (data?: GenOrData<In>) => LazyChain<In, Out>;
        asGenerator: (data?: GenOrData<In>) => AsyncGenerator<Out>;
        average: () => LazyChain<any, number>;
        chunk: (size: number, returnRemainers?: boolean) => LazyChain<In, Out>;
        debounce: (duration: Interval) => LazyChain<In, Out>;
        delay: (options: DelayOptions) => LazyChain<In, Out>;
        drop: (predicate: (value: In) => boolean) => LazyChain<In, Out>;
        duration: (period: Interval) => LazyChain<In, Out>;
        filter: (predicate: (input: any) => boolean) => LazyChain<In, Out>;
        firstOutput: (data?: GenOrData<In>) => Promise<Out | undefined>;
        fromFunction: (callback: () => any) => LazyChain<any, any>;
        input: (data: GenOrData<In>) => LazyChain<In, Out>;
        lastOutput: (data?: GenOrData<In>) => Promise<Out | undefined>;
        max: () => LazyChain<any, number>;
        min: () => LazyChain<any, number>;
        rank: (
            r: RankFunction<In>,
            options: Partial<RankOptions>,
        ) => LazyChain<In, Out>;
        rankArray: (
            r: RankFunction<In>,
            options: Partial<RankArrayOptions>,
        ) => LazyChain<In, Out>;
        reduce: (reducer: (values: any[]) => any) => LazyChain<In, Out>;
        sum: () => LazyChain<In, number>;
        take: (limit: number) => LazyChain<In, Out>;
        tally: (countArrayItems: boolean) => LazyChain<In, number>;
        transform: (transformer: (v: any) => any) => LazyChain<In, Out>;
    }

    Lazy execution of a chain

    Type Parameters

    • In
    • Out

    Type declaration

    • asArray: (data?: GenOrData<In>) => Promise<Out[]>

      Returns the results of the chain as an array. If data is not supplied, the last value given calling input(data) is used.

    • asAsync: (data?: GenOrData<In>) => LazyChain<In, Out>
    • asGenerator: (data?: GenOrData<In>) => AsyncGenerator<Out>

      Return the results of the chain as a regular generator. If data is not supplied, the last value given calling input(data) is used.

    • average: () => LazyChain<any, number>

      Gets the average numerical value (if relevant)

    • chunk: (size: number, returnRemainers?: boolean) => LazyChain<In, Out>

      Chunk values into arrays

    • debounce: (duration: Interval) => LazyChain<In, Out>

      Debounce values

    • delay: (options: DelayOptions) => LazyChain<In, Out>

      Delay emitting values

    • drop: (predicate: (value: In) => boolean) => LazyChain<In, Out>

      Ignore values that match predicate (opposite of filter())

    • duration: (period: Interval) => LazyChain<In, Out>

      Emit values until period has elapsed

    • filter: (predicate: (input: any) => boolean) => LazyChain<In, Out>

      Only allow values that meet predicate to pass

    • firstOutput: (data?: GenOrData<In>) => Promise<Out | undefined>

      Gets the first output value from the chain. If data is not supplied, the last value given calling input(data) is used.

    • fromFunction: (callback: () => any) => LazyChain<any, any>

      Uses a function as a source of values

    • input: (data: GenOrData<In>) => LazyChain<In, Out>

      Sets data to be the data for the chain

    • lastOutput: (data?: GenOrData<In>) => Promise<Out | undefined>

      Gets the last output value from the chain. If data is not supplied, the last value given calling input(data) is used.

    • max: () => LazyChain<any, number>

      Gets the maximum numerical value (if relevant)

    • min: () => LazyChain<any, number>

      Gets the minimum numerical value (if relevant)

    • rank: (r: RankFunction<In>, options: Partial<RankOptions>) => LazyChain<In, Out>

      Only emit values that have ranked higher than previously seen

    • rankArray: (r: RankFunction<In>, options: Partial<RankArrayOptions>) => LazyChain<In, Out>
    • reduce: (reducer: (values: any[]) => any) => LazyChain<In, Out>

      Flatten values in an array into a single value

    • sum: () => LazyChain<In, number>

      Gets the total of numerical values

    • take: (limit: number) => LazyChain<In, Out>

      Take limit number of values from the chain before ending

    • tally: (countArrayItems: boolean) => LazyChain<In, number>

      Emits a running tally of how many values have been emitted

    • transform: (transformer: (v: any) => any) => LazyChain<In, Out>

      Transform an input value to an output