Skip to content

waitForAbort<T = unknown>

Waits for an abort signal to abort and resolves with its reason.

Import:

import { waitForAbort } from 'obsidian-dev-utils/abort-controller';

Signature:

function waitForAbort(abortSignal: AbortSignal, shouldRejectOnAbort: boolean | undefined): Promise<T>

Parameters:

ParameterTypeDescription
abortSignalAbortSignalThe abort signal to wait for.
shouldRejectOnAbortboolean | undefinedWhether to reject the promise if the abort signal is aborted.

Returns: Promise<T> — A Promise that resolves with the reason of the abort signal.