> For the complete documentation index, see [llms.txt](https://henryruhs.gitbook.io/rxjs-collection/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://henryruhs.gitbook.io/rxjs-collection/introduction.md).

# Introduction

> RXJS enhanced Array, Map, WeakMap, Set and WeakSet.

### Installation

```
npm install rxjs-collection
```

### Usage

Each collection has been enhanced with `asObservable` and `{un}subscribe` alike methods:

```typescript
import { ReactiveMap } from 'rxjs-collection';

const reactiveMap : ReactiveMap<number, number> = new ReactiveMap<number, number>();

// subscribe to mutations
reactiveMap.asObservable().subscribe(map => map.has(1));
reactiveMap.subscribe(map => map.has(1));

// mutate the collection
reactiveMap.set(1, 1);

// unsubscribe from mutations
reactiveMap.unsubscribe();
```
