mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-19 19:11:35 +08:00
10 lines
264 B
TypeScript
10 lines
264 B
TypeScript
// because AbortSignal.throwIfAborted is not available in abortcontroller-polyfill
|
|
export function throwIfAborted(abort?: AbortSignal) {
|
|
if (abort?.aborted) {
|
|
throw new Error(abort.reason);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
export const MANUALLY_STOP = 'manually-stop';
|