MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / waitFor

Method waitFor

tooling/scripts/perf-desktop-runtime.mjs:349–359  ·  view source on GitHub ↗
(method, timeoutMs = 10000)

Source from the content-addressed store, hash-verified

347 }
348
349 waitFor(method, timeoutMs = 10000) {
350 return new Promise((resolvePromise, rejectPromise) => {
351 const timer = setTimeout(() => {
352 rejectPromise(new Error(`Timed out waiting for CDP event ${method}`))
353 }, timeoutMs)
354 this.on(method, (params) => {
355 clearTimeout(timer)
356 resolvePromise(params)
357 })
358 })
359 }
360
361 close() {
362 this.socket?.terminate?.()

Callers 1

mainFunction · 0.45

Calls 1

onMethod · 0.95

Tested by

no test coverage detected