rx-math
v1.1.4
Published
Reactive Math
Downloads
8
Maintainers
Readme
Reactive Math
Helpers to write functional reactive calculators.
Installation
npm install --save rx-math
Basic Usage
This is an oversimplification of how one would actually use RxMath
. In reality, the source Observables
will come from a form input, data service, or perhaps even another RxMath
calculation. It's likely that you'll also want to create a class
to encapsulate a more complex calculation.
let x: Observable<number> = Observable.of(123);
let y: Observable<number> = Observable.of(456);
let average: Observable<number> = RxMath.average(x, y);
average.subscribe((val: number) => {
console.log('Average is', val);
});
// outputs "Average is 289.5"