* This is similar to `.once()`, but returns a Promise that resolves the next time * the event is triggered, instead of calling a listener callback. * @returns a Promise that resolves the next time given event is triggered, * or rejects if an error is emitted. (If you request the 'error' ev
(event)
| 81638 | * @returns a Promise that resolves the next time given event is triggered, |
| 81639 | * or rejects if an error is emitted. (If you request the 'error' event, |
| 81640 | * returns a promise that resolves with the error). |
| 81641 | * |
| 81642 | * Example: |
| 81643 | * |
| 81644 | * const message = await stream.emitted('message') // rejects if the stream errors |
| 81645 | */ |
| 81646 | emitted(event) { |
| 81647 | return new Promise((resolve, reject) => { |
| 81648 | __classPrivateFieldSet8(this, _EventStream_catchingPromiseCreated, true, "f"); |
| 81649 | if (event !== "error") |
| 81650 | this.once("error", reject); |
nothing calls this directly
no test coverage detected