UNPKG

@empathyco/x-components

Version:
28 lines (16 loc) 1.3 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; [on](./x-components.xprioritybus.on.md) ## XPriorityBus.on() method Retrieves an observable for the event. See [XBus.on](./x-components.xbus.on.md)<!-- -->. **Signature:** ```typescript on<SomeEvent extends keyof SomeEvents>(event: SomeEvent, withMetadata?: boolean): typeof withMetadata extends true ? Observable<SubjectPayload<EventPayload<SomeEvents, SomeEvent>, SomeEventMetadata>> : Observable<EventPayload<SomeEvents, SomeEvent>>; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | | event | SomeEvent | Event to retrieve the observable for. | | withMetadata | boolean | _(Optional)_ Option to retrieve an observable with extra data about the event. | **Returns:** typeof withMetadata extends true ? Observable&lt;[SubjectPayload](./x-components.subjectpayload.md)<!-- -->&lt;[EventPayload](./x-components.eventpayload.md)<!-- -->&lt;SomeEvents, SomeEvent&gt;, SomeEventMetadata&gt;&gt; : Observable&lt;[EventPayload](./x-components.eventpayload.md)<!-- -->&lt;SomeEvents, SomeEvent&gt;&gt; The emitter for the event passed.