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



# Class: SubscriptionCollection


Creates a collection of subscriptions to which one can unsubscribe all at once.

## Implements

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

## Index

### Constructors

* [constructor](SubscriptionCollection.md#constructor)


### Methods

* [subscribe](SubscriptionCollection.md#subscribe)
* [unsubscribe](SubscriptionCollection.md#unsubscribe)



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


### ⊕ **new SubscriptionCollection**(topics?: *`string`⎮`Array`.<`string`>*, callback?: *[EventSubscriptionCallback](../#EventSubscriptionCallback)*): [SubscriptionCollection](SubscriptionCollection.md)


*Defined in [eventService.ts:70](https://github.com/daostack/arc.js/blob/77005d4/lib/eventService.ts#L70)*



**Parameters:**

| Param | Type | Description |
| ------ | ------ | ------ |
| topics | `string`⎮`Array`.<`string`>   |  - |
| callback | [EventSubscriptionCallback](../#EventSubscriptionCallback)   |  - |





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

---


## Methods
<a id="subscribe"></a>

###  subscribe

► **subscribe**(topics: *`string`⎮`Array`.<`string`>*, callback: *[EventSubscriptionCallback](../#EventSubscriptionCallback)*): `void`



*Defined in [eventService.ts:85](https://github.com/daostack/arc.js/blob/77005d4/lib/eventService.ts#L85)*



Subscribe a single callback to a set of events


**Parameters:**

| Param | Type | Description |
| ------ | ------ | ------ |
| topics | `string`⎮`Array`.<`string`>   |  - |
| callback | [EventSubscriptionCallback](../#EventSubscriptionCallback)   |  - |





**Returns:** `void`





___

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

###  unsubscribe

► **unsubscribe**(): `void`



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

*Defined in [eventService.ts:98](https://github.com/daostack/arc.js/blob/77005d4/lib/eventService.ts#L98)*



Unsubscribe from all of the events




**Returns:** `void`





___


