| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 19fb134 commit 36207c6
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -130,7 +130,7 @@ myEmitter.emit('event'); | |||
| 130 | 130 | ``` | |
| 131 | 131 | ||
| 132 | 132 | Using the `eventEmitter.once()` method, it is possible to register a listener | |
| 133 | - that is immediately unregistered after it is called. | ||
| 133 | + that is unregistered before it is called. | ||
| 134 | 134 | ||
| 135 | 135 | ```js | |
| 136 | 136 | const myEmitter = new MyEmitter(); | |
@@ -376,9 +376,8 @@ myEE.emit('foo'); | |||
| 376 | 376 | * `eventName` {string|Symbol} The name of the event. | |
| 377 | 377 | * `listener` {Function} The callback function | |
| 378 | 378 | ||
| 379 | - Adds a **one time** `listener` function for the event named `eventName`. This | ||
| 380 | - listener is invoked only the next time `eventName` is triggered, after which | ||
| 381 | - it is removed. | ||
| 379 | + Adds a **one time** `listener` function for the event named `eventName`. The | ||
| 380 | + next time `eventName` is triggered, this listener is removed and then invoked. | ||
| 382 | 381 | ||
| 383 | 382 | ```js | |
| 384 | 383 | server.once('connection', (stream) => { | |
@@ -427,8 +426,8 @@ Returns a reference to the `EventEmitter` so calls can be chained. | |||
| 427 | 426 | * `listener` {Function} The callback function | |
| 428 | 427 | ||
| 429 | 428 | Adds a **one time** `listener` function for the event named `eventName` to the | |
| 430 | - *beginning* of the listeners array. This listener is invoked only the next time | ||
| 431 | - `eventName` is triggered, after which it is removed. | ||
| 429 | + *beginning* of the listeners array. The next time `eventName` is triggered, this | ||
| 430 | + listener is removed, and then invoked. | ||
| 432 | 431 | ||
| 433 | 432 | ```js | |
| 434 | 433 | server.prependOnceListener('connection', (stream) => { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments