rx-math
TypeScript icon, indicating that this package has built-in type declarations

1.1.4 • Public • Published

Reactive Math

Dependencies Status devDependency Status npm GitHub license Build Status

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"

/rx-math/

    Package Sidebar

    Install

    npm i rx-math

    Weekly Downloads

    0

    Version

    1.1.4

    License

    MIT

    Last publish

    Collaborators

    • darrylhodgins