t-hooks
    Preparing search index...

    Function useCompatTaskCallback

    • Type Parameters

      • A extends any[]

        callback argument types

      • R

        resulting task resolve type

      Parameters

      • taskFunction: TaskFunction<A, R>

        task function to be invoked as callback

      • deps: DependencyList

        dependency list; the task function is memoized with these dependencies

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

      callback returning the started task

      Use useTaskCallback when the callback task resolves to void. This hook remains for callbacks whose task resolves to a result.

      Convenience binding of useCompatTaskCallbackState

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

      useCompatTaskCallbackState