t-hooks
    Preparing search index...

    Function useCompatGeneratorCallback

    • Type Parameters

      • A extends any[]

        callback argument types

      • T

        yielded underlying type

      • TT extends Task<T>

        yielded task type

      • R

        resulting task resolve type

      Parameters

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

        task generator function

      • deps: DependencyList

        dependency list

      Returns (...args: A) => Task<R>

      callback returning the started task

      Use useGeneratorCallback when the generator returns void. This hook remains for generators that return a result.

      Convenience binding of useCompatGeneratorCallbackState

      The returned callback yields the started task. Running status and cancel are omitted; cancel that task from the callback result.

      useCompatGeneratorCallbackState