Function useBlocker

  • Block an async flow and unblock it from an external context.

    Returns [isBlocked: boolean, block: (() => Promise<void>), unblock: (() => void)]

  • Block an async flow and unblock it from an external context.

    Type Parameters

    • T

      The type of value that can be passed to unblock to resolve the Promise returned by block.

    Returns [isBlocked: boolean, block: (() => Promise<T>), unblock: ((result) => void)]