@empathyco/x-components
Version:
Empathy X Components
98 lines (45 loc) • 1.72 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [XPriorityBus](./x-components.xprioritybus.md)
## XPriorityBus class
A default [XBus](./x-components.xbus.md) implementation using a [priority queue](./x-components.xpriorityqueue.md) as its data structure to prioritise the emission of events. The priorities are preconfigured based on event naming.
**Signature:**
```typescript
export declare class XPriorityBus<SomeEvents extends Dictionary, SomeEventMetadata extends XPriorityBusEventMetadata> implements XBus<SomeEvents, SomeEventMetadata>
```
**Implements:** [XBus](./x-components.xbus.md)<!-- --><SomeEvents, SomeEventMetadata>
## Constructors
<table><thead><tr><th>
Constructor
</th><th>
Modifiers
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
[(constructor)(config)](./x-components.xprioritybus._constructor_.md)
</td><td>
</td><td>
Creates a new instance of a [XPriorityBus](./x-components.xprioritybus.md)<!-- -->.
</td></tr>
</tbody></table>
## Methods
<table><thead><tr><th>
Method
</th><th>
Modifiers
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
[emit(event, payload, metadata)](./x-components.xprioritybus.emit.md)
</td><td>
</td><td>
Emits an event. See [XBus.emit](./x-components.xbus.emit.md)<!-- -->.
</td></tr>
<tr><td>
[on(event, withMetadata)](./x-components.xprioritybus.on.md)
</td><td>
</td><td>
Retrieves an observable for the event. See [XBus.on](./x-components.xbus.on.md)<!-- -->.
</td></tr>
</tbody></table>