Function useGeneratorMemoState

  • Generator-based asynchronous memo hook

    Generator version of task-memo converting generator to compound task first

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

    Type Parameters

    • T

    • TT extends Task<T>

      yielded task type

    • R

      resulting task resolve type

    Parameters

    • initialValue: R

      initial value available immediately

    • taskGeneratorFunction: TaskGeneratorFunction<[], T, TT, R>

      task generator function

    • deps: DependencyList

      dependency list

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

    memorized value, current execution status (running or not) and cancellation function

    See

    useTaskMemoState

Generated using TypeDoc