Stone.js API
    Preparing search index...

    Class representing an EventEmitter.

    Index
    • Emits an event, triggering all associated listeners in registration order.

      Always returns a promise: await emit(...) waits for every (sync and async) listener to settle. A synchronous caller may fire-and-forget, but then it opts out of awaiting async listeners and of handling their errors.

      Listeners are isolated: one that throws or rejects does not prevent the others from running. If any listener fails, emit rejects after all have run — with the single error, or an AggregateError when several failed.

      Type Parameters

      Parameters

      • event: string | symbol | TEvent

        The event name or an instance of Event.

      • Optionalargs: any

        Additional arguments to pass to the listeners.

      Returns Promise<void>