<commit_before># rx-undoable

Easily undo and redo RxJS observables.

Great for adding undo and redo buttons to Cycle.js applications.

Installation
---

`npm install --save rx-undoable`

Usage
---

```
import undoableScan = 'rx-undoable';

const numbers$ = Rx.Observable.range(1, 5);

const undo$ = ... // observable of undo intent, like clicking an undo button

const undoableSum$ = undoableScan(
  numbers$,
  (total, change) => total + change,
  0,
  undo$
).pluck('present');
```


API
---

###`undoableScan(stream$, accumulator, seed, undo$, [redo$])`

Which is equivalent to `stream$.scan(accumulator, seed)`, expect that data is returned in this format:
<commit_msg>Fix typo in readme<commit_after># rx-undoable

Easily undo and redo RxJS observables.

Great for adding undo and redo buttons to Cycle.js applications.

Installation
---

`npm install --save rx-undoable`

Usage
---

```
import undoableScan = 'rx-undoable';

const numbers$ = Rx.Observable.range(1, 5);

const undo$ = ... // observable of undo intent, like clicking an undo button

const undoableSum$ = undoableScan(
  numbers$,
  (total, change) => total + change,
  0,
  undo$
).pluck('present');
```


API
---

###`undoableScan(stream$, accumulator, seed, undo$, [redo$])`

Which is equivalent to `stream$.scan(accumulator, seed)`, except that data is returned in this format:

{'fraction_non_alphanumeric': 0.14042867701404288, 'fraction_numerical': 0.004434589800443459, 'mean_word_length': 4.014814814814815, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3447226', 'n_tokens_mistral': 478, 'n_tokens_neox': 435, 'n_words': 149}