* 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)
| 70345 | * @returns a Promise that resolves the next time given event is triggered, |
| 70346 | * or rejects if an error is emitted. (If you request the 'error' event, |
| 70347 | * returns a promise that resolves with the error). |
| 70348 | * |
| 70349 | * Example: |
| 70350 | * |
| 70351 | * const message = await stream.emitted('message') // rejects if the stream errors |
| 70352 | */ |
| 70353 | emitted(event) { |
| 70354 | return new Promise((resolve, reject) => { |
| 70355 | __classPrivateFieldSet6(this, _MessageStream_catchingPromiseCreated, true, "f"); |
| 70356 | if (event !== "error") |
| 70357 | this.once("error", reject); |
nothing calls this directly
no test coverage detected