MCPcopy
hub / github.com/di-sukharev/opencommit / emitted

Method emitted

out/cli.cjs:81640–81647  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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);

Callers

nothing calls this directly

Calls 2

__classPrivateFieldSet8Function · 0.85
onceMethod · 0.45

Tested by

no test coverage detected