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

Method once

lib/internal/event_target.js:1017–1023  ·  view source on GitHub ↗

* @param {string} type * @param {EventTargetCallback|EventListener} listener * @returns {NodeEventTarget}

(type, listener)

Source from the content-addressed store, hash-verified

1015 * @returns {NodeEventTarget}
1016 */
1017 once(type, listener) {
1018 if (!isNodeEventTarget(this))
1019 throw new ERR_INVALID_THIS('NodeEventTarget');
1020 this.addEventListener(type, listener,
1021 { once: true, [kIsNodeStyleListener]: true });
1022 return this;
1023 }
1024
1025 /**
1026 * @param {string} [type]

Callers

nothing calls this directly

Calls 2

isNodeEventTargetFunction · 0.85
addEventListenerMethod · 0.65

Tested by

no test coverage detected