MCPcopy
hub / github.com/refined-github/refined-github / delay

Function delay

source/helpers/delay.ts:1–11  ·  view source on GitHub ↗
(ms: number, signal?: AbortSignal)

Source from the content-addressed store, hash-verified

1export default async function delay(ms: number, signal?: AbortSignal): Promise<void> {
2 signal?.throwIfAborted();
3 await new Promise<void>((resolve, reject) => {
4 const timeout = setTimeout(resolve, ms);
5 signal?.addEventListener('abort', () => {
6 clearTimeout(timeout);
7 // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors -- Pass as is
8 reject(signal.reason);
9 });
10 });
11}

Callers 13

finalUpdateToastFunction · 0.85
showToastFunction · 0.85
waitForFunction · 0.85
observeFunction · 0.85
initFunction · 0.85
setVersionFunction · 0.85
unhideFunction · 0.85
addSidebarReviewButtonsFunction · 0.85
openReviewPopupFunction · 0.85
handleErroredImageFunction · 0.85
addWidgetFunction · 0.85
initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected