UNPKG

@empathyco/x-components

Version:
26 lines (17 loc) 1.51 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; [(constructor)](./x-components.xprioritybus._constructor_.md) ## XPriorityBus.(constructor) Creates a new instance of a [XPriorityBus](./x-components.xprioritybus.md)<!-- -->. **Signature:** ```typescript constructor(config?: { queue?: XPriorityQueue<SomeEvents, XPriorityQueueNodeData<SomeEvents, SomeEventMetadata>>; priorities?: Dictionary<number>; emitCallbacks?: AnyFunction[]; defaultEventPriority?: number; }); ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | | config | { queue?: [XPriorityQueue](./x-components.xpriorityqueue.md)<!-- -->&lt;SomeEvents, [XPriorityQueueNodeData](./x-components.xpriorityqueuenodedata.md)<!-- -->&lt;SomeEvents, SomeEventMetadata&gt;&gt;; priorities?: Dictionary&lt;number&gt;; emitCallbacks?: AnyFunction\[\]; defaultEventPriority?: number; } | _(Optional)_ A configuration object to initialise the bus. - param config.queue - A [priority queue](./x-components.xpriorityqueue.md) to store the events. - param config.priorities - A Dictionary defining the priorities associated to a given string. - param config.emitCallbacks - A list of functions to execute when an event is emitted. - param config.defaultEventPriority - A default priority to assigned to an event. |