Files
AFFiNE-Mirror/packages/common/nbstore/src/utils/throw-if-aborted.ts
T

10 lines
253 B
TypeScript

// because AbortSignal.throwIfAborted is not available in abortcontroller-polyfill
export function throwIfAborted(abort?: AbortSignal) {
if (abort?.aborted) {
throw abort.reason;
}
return true;
}
export const MANUALLY_STOP = 'manually-stop';