Function useGeneratorMemo

  • Generator-based asynchronous memo hook (convinience binding)

    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 R

    memorized value

    See

    useGeneratorMemoState

Generated using TypeDoc