Files
medusa-store/www/apps/docs/content/references/services/interfaces/IEventBusService.mdx
github-actions[bot] cdd42dbdcd chore(docs): Generated References (#5743)
Generated the following references:
- `entities`
- `inventory`
- `js-client`
- `pricing`
- `product`
- `services`
- `stock-location`
- `workflows`

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
2023-11-27 18:58:52 +00:00

220 lines
4.0 KiB
Plaintext

---
displayed_sidebar: servicesSidebar
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# IEventBusService
## Methods
#### emit
`**emit**<TypeParameter T>(event, data, options?): Promise&#60;unknown&#62;`
##### Type Parameters
<ParameterTypes parameters={[
{
"name": "T",
"type": "`object`",
"description": "",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
}
]} />
##### Parameters
<ParameterTypes parameters={[
{
"name": "event",
"type": "`string`",
"description": "",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "data",
"type": "`T`",
"description": "",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "options",
"type": "`unknown`",
"description": "",
"optional": true,
"defaultValue": "",
"expandable": false,
"children": []
}
]} />
##### Returns
Promise&#60;unknown&#62;
<ParameterTypes parameters={[
{
"name": "Promise",
"type": "Promise&#60;unknown&#62;",
"optional": false,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
___
#### subscribe
`**subscribe**(eventName, subscriber, context?): [IEventBusService](IEventBusService.mdx)`
##### Parameters
<ParameterTypes parameters={[
{
"name": "eventName",
"type": "`string` \\| `symbol`",
"description": "",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "subscriber",
"type": "[Subscriber](../types/Subscriber.mdx)",
"description": "",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "context",
"type": "[SubscriberContext](../types/SubscriberContext.mdx)",
"description": "",
"optional": true,
"defaultValue": "",
"expandable": false,
"children": []
}
]} />
##### Returns
[IEventBusService](IEventBusService.mdx)
<ParameterTypes parameters={[
{
"name": "IEventBusService",
"type": "[IEventBusService](IEventBusService.mdx)",
"optional": false,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
___
#### unsubscribe
`**unsubscribe**(eventName, subscriber, context?): [IEventBusService](IEventBusService.mdx)`
##### Parameters
<ParameterTypes parameters={[
{
"name": "eventName",
"type": "`string` \\| `symbol`",
"description": "",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "subscriber",
"type": "[Subscriber](../types/Subscriber.mdx)",
"description": "",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "context",
"type": "[SubscriberContext](../types/SubscriberContext.mdx)",
"description": "",
"optional": true,
"defaultValue": "",
"expandable": false,
"children": []
}
]} />
##### Returns
[IEventBusService](IEventBusService.mdx)
<ParameterTypes parameters={[
{
"name": "IEventBusService",
"type": "[IEventBusService](IEventBusService.mdx)",
"optional": false,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
___
#### withTransaction
`**withTransaction**(transactionManager?): [IEventBusService](IEventBusService.mdx)`
##### Parameters
<ParameterTypes parameters={[
{
"name": "transactionManager",
"type": "EntityManager",
"description": "",
"optional": true,
"defaultValue": "",
"expandable": false,
"children": []
}
]} />
##### Returns
[IEventBusService](IEventBusService.mdx)
<ParameterTypes parameters={[
{
"name": "IEventBusService",
"type": "[IEventBusService](IEventBusService.mdx)",
"optional": false,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />