t-hooks
    Preparing search index...

    Function useTaskCallback

    • Task-based asynchronous callback hook (convenience binding)

      Task equivalent to useCallback hook allowing to perform asynchronous callbacks

      Task execution is automatically interrupted in case of additional calls or unmounting. This way, only one task is running at any given time

      Type Parameters

      • A extends any[]

        callback argument types

      Parameters

      • taskFunction: TaskFunction<A, void>

        task function to be invoked as callback; the task resolves to void

      • deps: DependencyList

        dependency list

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

      callback to be invoked

      useTaskCallbackState

      Task is not cancelled on hook re-render, but is cancelled on the next call instead