MCPcopy
hub / github.com/socketio/socket.io / waitFor

Function waitFor

docs/engine.io-protocol/v3-test-suite/test-suite.js:20–30  ·  view source on GitHub ↗
(socket, eventType)

Source from the content-addressed store, hash-verified

18}
19
20function waitFor(socket, eventType) {
21 return new Promise((resolve) => {
22 socket.addEventListener(
23 eventType,
24 (event) => {
25 resolve(event);
26 },
27 { once: true }
28 );
29 });
30}
31
32function decodePayload(payload) {
33 const firstColonIndex = payload.indexOf(":");

Callers 1

test-suite.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected