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

Method waitFor

tooling/scripts/perf-web-runtime.mjs:378–388  ·  view source on GitHub ↗
(method, timeoutMs = 10000)

Source from the content-addressed store, hash-verified

376 }
377
378 waitFor(method, timeoutMs = 10000) {
379 return new Promise((resolvePromise, rejectPromise) => {
380 const timer = setTimeout(() => {
381 rejectPromise(new Error(`Timed out waiting for CDP event ${method}`))
382 }, timeoutMs)
383 this.on(method, (params) => {
384 clearTimeout(timer)
385 resolvePromise(params)
386 })
387 })
388 }
389
390 close() {
391 this.socket?.terminate?.()

Callers 1

mainFunction · 0.45

Calls 1

onMethod · 0.95

Tested by

no test coverage detected