UNPKG

@empathyco/x-components

Version:
29 lines (17 loc) 1.13 kB
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [XPriorityBus](./x-components.xprioritybus.md) &gt; [emit](./x-components.xprioritybus.emit.md) ## XPriorityBus.emit() method Emits an event. See [XBus.emit](./x-components.xbus.emit.md)<!-- -->. **Signature:** ```typescript emit<SomeEvent extends keyof SomeEvents>(event: SomeEvent, payload?: EventPayload<SomeEvents, SomeEvent>, metadata?: SomeEventMetadata): Promise<EmittedData<SomeEvents, SomeEvent, SomeEventMetadata>>; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | | event | SomeEvent | Event to be emitted. | | payload | [EventPayload](./x-components.eventpayload.md)<!-- -->&lt;SomeEvents, SomeEvent&gt; | _(Optional)_ Event payload. | | metadata | SomeEventMetadata | _(Optional)_ Extra event data. | **Returns:** Promise&lt;[EmittedData](./x-components.emitteddata.md)<!-- -->&lt;SomeEvents, SomeEvent, SomeEventMetadata&gt;&gt; A promise that is resolved the moment the event is emitted.