emitter.prependOnceListener(eventName, listener)


将名为 eventName 的事件的单次 listener 函数添加到监听器数组的开头。 下次触发 eventName 时,将移除此监听器,然后再调用。

server.prependOnceListener('connection', (stream) => {
  console.log('Ah, we have our first user!');
});

返回对 EventEmitter 的引用,以便可以链式调用。

Adds a one-time listener function for the event named eventName to the beginning of the listeners array. The next time eventName is triggered, this listener is removed, and then invoked.

server.prependOnceListener('connection', (stream) => {
  console.log('Ah, we have our first user!');
});

Returns a reference to the EventEmitter, so that calls can be chained.