t-hooks
    Preparing search index...

    Function useMultiGeneratorCallback

    • Generator-based callback hook that allows concurrent tasks

      Generator version of useMultiTaskCallback, converting the generator to a compound task first

      Each call starts a new task and leaves tasks already running in place. Every in-flight task is cancelled on unmount. Dependency changes do not cancel work already started.

      Type Parameters

      • A extends any[]

        callback argument types

      • T

        yielded underlying type

      • TT extends Task<T>

        yielded task type

      Parameters

      • taskGeneratorFunction: TaskGeneratorFunction<A, T, TT, void>

        task generator function; the generator returns void

      • deps: DependencyList

        dependency list

      Returns (...args: A) => void

      callback to be invoked

      useMultiTaskCallback