Files
medusa-store/www/apps/docs/content/references/services/interfaces/IEventBusService.mdx
Shahed Nasser c6dff873de docs: update docusaurus to v3 (#5625)
* update dependencies

* update onboarding mdx

* fixes for mdx issues

* fixes for mdx compatibility

* resolve mdx errors

* fixes in reference

* fix check errors

* revert change in vale action

* fix node version in action

* fix summary in markdown
2023-11-13 20:11:50 +02:00

218 lines
3.9 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;`
<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": []
}
]} />