MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / timeout

Method timeout

examples/io/streams/modules/streams.js:117–123  ·  view source on GitHub ↗
(duration)

Source from the content-addressed store, hash-verified

115 return signal.self;
116 }
117 static timeout(duration) {
118 const signal = new AbortSignal(AbortSignalBrand.token);
119 setTimeout(() => {
120 triggerAbortSignal(signal, new Error());
121 }, duration);
122 return signal.self;
123 }
124}
125function triggerAbortSignal(signal, reason) {
126 if (signal.aborted)

Callers 2

testharness.jsFile · 0.45
timeoutFunction · 0.45

Calls 1

triggerAbortSignalFunction · 0.85

Tested by

no test coverage detected