Function useGeneratorEffect

  • Generator-invoking hook

    Generator version of task-effect 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

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

      task generator function

    • deps: DependencyList

      dependency list

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

    current execution status (running or not) and cancellation function

    See

    useTaskEffect

Generated using TypeDoc