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

Method emitted

out/cli.cjs:70347–70354  ·  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

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

Callers

nothing calls this directly

Calls 2

onceMethod · 0.95
__classPrivateFieldSet6Function · 0.85

Tested by

no test coverage detected