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



# Class: EventSubscription

## Implements

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

## Index

### Constructors

* [constructor](EventSubscription.md#constructor)


### Methods

* [unsubscribe](EventSubscription.md#unsubscribe)



---
## Constructors
<a id="constructor"></a>


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


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



**Parameters:**

| Param | Type | Description |
| ------ | ------ | ------ |
| 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/f343aa24/lib/pubSubEventService.ts#L212)*



Unsubscribes after optional timeout.


**Parameters:**

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





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





___


