t-hooks
    Preparing search index...

    Function useTaskMemoState

    • Task-based asynchronous memo hook

      Task-based hook for asynchronous memoized transformations

      Task execution is automatically interrupted in case of hook re-render or unmounting. This way, only one task is running at any given time

      Type Parameters

      • T

        resulting task resolve type

      Parameters

      • initialValue: T

        initial value available immediately

      • taskFunction: TaskFunction<[], T>

        task function to be invoked to get the transformed value

      • deps: DependencyList

        dependency list

      Returns readonly [T, boolean, () => void]

      memoized value, current execution status, and cancellation function, as [state, running, cancel]