MCPcopy Index your code
hub / github.com/nodejs/node / onceAnEventWithTwoArgs

Function onceAnEventWithTwoArgs

test/parallel/test-events-once.js:31–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29}
30
31async function onceAnEventWithTwoArgs() {
32 const ee = new EventEmitter();
33
34 process.nextTick(() => {
35 ee.emit('myevent', 42, 24);
36 });
37
38 const value = await once(ee, 'myevent');
39 assert.deepStrictEqual(value, [42, 24]);
40}
41
42async function catchesErrors() {
43 const ee = new EventEmitter();

Callers 1

Calls 2

onceFunction · 0.70
emitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…