MCPcopy
hub / github.com/philc/vimium / promiseWithTimeout

Function promiseWithTimeout

lib/utils.js:211–216  ·  view source on GitHub ↗
(promise, ms)

Source from the content-addressed store, hash-verified

209 },
210
211 promiseWithTimeout(promise, ms) {
212 const timeoutPromise = new Promise((_resolve, reject) => {
213 setTimeout(() => reject(new Error(`Promise timed out after ${ms}ms.`)), ms);
214 });
215 return Promise.race([promise, timeoutPromise]);
216 },
217
218 // Make an idempotent function.
219 makeIdempotent(func) {

Callers

nothing calls this directly

Calls 1

setTimeoutFunction · 0.85

Tested by

no test coverage detected