diff --git a/doc/api/events.md b/doc/api/events.md index 501a94b79d7dc7..6e74760d8f35df 100644 --- a/doc/api/events.md +++ b/doc/api/events.md @@ -130,7 +130,7 @@ myEmitter.emit('event'); ``` Using the `eventEmitter.once()` method, it is possible to register a listener -that is immediately unregistered after it is called. +that is unregistered before it is called. ```js const myEmitter = new MyEmitter(); @@ -376,9 +376,8 @@ myEE.emit('foo'); * `eventName` {string|Symbol} The name of the event. * `listener` {Function} The callback function -Adds a **one time** `listener` function for the event named `eventName`. This -listener is invoked only the next time `eventName` is triggered, after which -it is removed. +Adds a **one time** `listener` function for the event named `eventName`. The +next time `eventName` is triggered, this listener is removed and then invoked. ```js server.once('connection', (stream) => { @@ -427,8 +426,8 @@ Returns a reference to the `EventEmitter` so calls can be chained. * `listener` {Function} The callback function Adds a **one time** `listener` function for the event named `eventName` to the -*beginning* of the listeners array. This listener is invoked only the next time -`eventName` is triggered, after which it is removed. +*beginning* of the listeners array. The next time `eventName` is triggered, this +listener is removed, and then invoked. ```js server.prependOnceListener('connection', (stream) => {