import ParameterTypes from "@site/src/components/ParameterTypes"

# IEventBusModuleService

## Methods

### emit

`**emit**<TypeParameter T>(eventName, data, options?): Promise&#60;void&#62;`

#### Type Parameters

<ParameterTypes parameters={[
  {
    "name": "T",
    "type": "`object`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "eventName",
    "type": "`string`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "data",
    "type": "`T`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "options",
    "type": "`Record<string, unknown>`",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;void&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "",
    "expandable": false,
    "children": []
  }
]} />

`**emit**<TypeParameter T>(data): Promise&#60;void&#62;`

#### Type Parameters

<ParameterTypes parameters={[
  {
    "name": "T",
    "type": "`object`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "data",
    "type": "[EmitData](../types/types.EventBusTypes.EmitData.mdx)&#60;T&#62;[]",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": [
      {
        "name": "data",
        "type": "`T`",
        "description": "",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "eventName",
        "type": "`string`",
        "description": "",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "options",
        "type": "`Record<string, unknown>`",
        "description": "",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      }
    ]
  }
]} />

#### Returns

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;void&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "",
    "expandable": false,
    "children": []
  }
]} />

___

### subscribe

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "eventName",
    "type": "`string` \\| `symbol`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "subscriber",
    "type": "[Subscriber](../types/types.EventBusTypes.Subscriber.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "context",
    "type": "[SubscriberContext](../types/types.EventBusTypes.SubscriberContext.mdx)",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": [
      {
        "name": "subscriberId",
        "type": "`string`",
        "description": "",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      }
    ]
  }
]} />

#### Returns

<ParameterTypes parameters={[
  {
    "name": "emit",
    "type": "`<T>`(`eventName`: `string`, `data`: `T`, `options?`: `Record<string, unknown>`) => Promise&#60;void&#62;`<T>`(`data`: [EmitData](../types/types.EventBusTypes.EmitData.mdx)&#60;T&#62;[]) => Promise&#60;void&#62;",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "subscribe",
    "type": "(`eventName`: `string` \\| `symbol`, `subscriber`: [Subscriber](../types/types.EventBusTypes.Subscriber.mdx), `context?`: [SubscriberContext](../types/types.EventBusTypes.SubscriberContext.mdx)) => [IEventBusModuleService](types.EventBusTypes.IEventBusModuleService.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "unsubscribe",
    "type": "(`eventName`: `string` \\| `symbol`, `subscriber`: [Subscriber](../types/types.EventBusTypes.Subscriber.mdx), `context?`: [SubscriberContext](../types/types.EventBusTypes.SubscriberContext.mdx)) => [IEventBusModuleService](types.EventBusTypes.IEventBusModuleService.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

___

### unsubscribe

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "eventName",
    "type": "`string` \\| `symbol`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "subscriber",
    "type": "[Subscriber](../types/types.EventBusTypes.Subscriber.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "context",
    "type": "[SubscriberContext](../types/types.EventBusTypes.SubscriberContext.mdx)",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": [
      {
        "name": "subscriberId",
        "type": "`string`",
        "description": "",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      }
    ]
  }
]} />

#### Returns

<ParameterTypes parameters={[
  {
    "name": "emit",
    "type": "`<T>`(`eventName`: `string`, `data`: `T`, `options?`: `Record<string, unknown>`) => Promise&#60;void&#62;`<T>`(`data`: [EmitData](../types/types.EventBusTypes.EmitData.mdx)&#60;T&#62;[]) => Promise&#60;void&#62;",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "subscribe",
    "type": "(`eventName`: `string` \\| `symbol`, `subscriber`: [Subscriber](../types/types.EventBusTypes.Subscriber.mdx), `context?`: [SubscriberContext](../types/types.EventBusTypes.SubscriberContext.mdx)) => [IEventBusModuleService](types.EventBusTypes.IEventBusModuleService.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "unsubscribe",
    "type": "(`eventName`: `string` \\| `symbol`, `subscriber`: [Subscriber](../types/types.EventBusTypes.Subscriber.mdx), `context?`: [SubscriberContext](../types/types.EventBusTypes.SubscriberContext.mdx)) => [IEventBusModuleService](types.EventBusTypes.IEventBusModuleService.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />
