Type alias AsyncEffectCallback

AsyncEffectCallback: ((signal) => PromiseLike<(() => void) | void>)

Type declaration

    • (signal): PromiseLike<(() => void) | void>
    • The callback provided to useAsyncEffect.

      The returned cleanup callback is ignored if signal was aborted.

      Parameters

      • signal: AbortSignal

        The signal that is aborted when effect was discarded.

      Returns PromiseLike<(() => void) | void>

      The cleanup callback that is invoked when effect unmounted.