mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 20:38:52 +00:00
This PR copying @affine/workspace into common/infra, and adding definitions for services and unit tests.
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';
|