0.1.2 • Published 7 years ago

rxjs-diff-operator v0.1.2

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

rxjs-diff-operator

Greenkeeper badge NPM version Build Status Coverage Status Standard Version

this package adds toDiff/fromDiff operators for RxJs 5. for more deep information about the operator and the protocol, please check observable-diff-operator

Operators:

toDiff

signature: toDiff(): Observable<IObservableDiff>

Description

toDiff operator is used to convert output of an obsersvable stream, into a stream that contains diff information. this operator is inteded to be used on the server.

Example
//emit (1,2,3,4,5)
const source = Rx.Observable.from([1,2,3,4,5]);
//add 10 to each value
const example = source.toDiff();
//output: { type: "init", payload: 1, isObject: false }, { type: "update", payload: 2 }, ...
const subscribe = example.subscribe(val => console.log(val));

fromDiff

signature: fromDiff(): Observable<any>

Description

fromDiff operator is used to convert output of an diff obsersvable stream (see toDiff above), into a stream that contains diff information. this operator is inteded to be used on the client.

Example
//emit diff information
const source = Rx.Observable.from([{ type: "init", payload: 1, isObject: false }, { type: "update", payload: 2 }, { type: "complete" }]);
//add 10 to each value
const example = source.fromDiff();
//output: 1, 2
const subscribe = example.subscribe(val => console.log(val));

Contributions

Contributions, issues and feature requests are very welcome. If you are using this package and fixed a bug for yourself, please consider submitting a PR!

0.1.2

7 years ago

0.1.2-1

7 years ago

0.1.2-0

7 years ago

0.1.1

7 years ago

0.1.1-1

7 years ago

0.1.1-0

7 years ago

0.1.0

8 years ago