[API Reference](../README.md) > [EventSubscription](../classes/EventSubscription.md)

# Class: EventSubscription

## Hierarchy

**EventSubscription**

## Implements

* [IEventSubscription](../interfaces/IEventSubscription.md)

## Index

### Constructors

* [constructor](EventSubscription.md#constructor)

### Methods

* [unsubscribe](EventSubscription.md#unsubscribe)

---

## Constructors

<a id="constructor"></a>

###  constructor

⊕ **new EventSubscription**(key: *[EventSubscriptionKey](../#EventSubscriptionKey)*): [EventSubscription](EventSubscription.md)

*Defined in [pubSubEventService.ts:203](https://github.com/daostack/arc.js/blob/6f704389/lib/pubSubEventService.ts#L203)*

**Parameters:**

| Param | Type |
| ------ | ------ |
| key | [EventSubscriptionKey](../#EventSubscriptionKey) |

**Returns:** [EventSubscription](EventSubscription.md)

___

## Methods

<a id="unsubscribe"></a>

###  unsubscribe

▸ **unsubscribe**(milliseconds?: *`number`*): `Promise`<`void`>

*Implementation of [IEventSubscription](../interfaces/IEventSubscription.md).[unsubscribe](../interfaces/IEventSubscription.md#unsubscribe)*

*Defined in [pubSubEventService.ts:212](https://github.com/daostack/arc.js/blob/6f704389/lib/pubSubEventService.ts#L212)*

Unsubscribes after optional timeout.

**Parameters:**

| Param | Type | Default value | Description |
| ------ | ------ | ------ | ------ |
| `Default value` milliseconds | `number` |  -1 |  number of milliseconds to timeout. Default is -1 which means not to timeout at all. |

**Returns:** `Promise`<`void`>

___

