t-hooks
    Preparing search index...

    Function useCompatGeneratorCallbackState

    • 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 readonly [(...args: A) => Task<R>, boolean, () => void]

      callback returning the started task, current execution status, and cancellation function, as [callback, running, cancel]

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

      Generator-based asynchronous callback hook that returns the started task

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

      useCompatTaskCallbackState