Repository
Current version released
4 years ago
Versions
- v0.0.47Latest
- v0.0.46
- v0.0.45
- v0.0.44
- v0.0.43
- v0.0.42
- v0.0.41
- v0.0.40
- v0.0.39
- v0.0.38
- v0.0.37
- v0.0.36
- v0.0.35
- v0.0.34
- v0.0.33
- v0.0.32
- v0.0.31
- v0.0.30
- v0.0.29
- v0.0.28
- v0.0.27
- v0.0.26
- v0.0.25
- v0.0.24
- v0.0.23
- v0.0.22
- v0.0.21
- v0.0.20
- v0.0.19
- v0.0.18
- v0.0.17
- v0.0.16
- v0.0.15
- v0.0.14
- v0.0.13
- v0.0.12
- v0.0.11
- v0.0.10
- v0.0.9
- v0.0.8
- v0.0.7
- v0.0.6
- v0.0.5
- v0.0.4
- v0.0.3
- v0.0.2
- v0.0.1
Reactive JS:
Fast modern reactive Javascript programming library
Example Usage
import { pipe } from "@reactive-js/pipe";
import {
exhaust,
fromArray,
generate,
map,
onNotify,
subscribe
} from "@reactive-js/observable";
import { normalPriority } from "@reactive-js/react-scheduler";
// The pipe function can be used to compose operators.
const subscription = pipe(
// The event source is a generator that generates numbers as fast
// as it can. Note this work is still done concurrently with
// other worked scheduled on the scheduler. The generate function yields
// to the scheduler to let it do other work such as letting
// the browser paint or allowing react to render component
// trees.
generate(x => x + 1, 0),
map(x => fromArray([x, x, x, x])),
exhaust(),
// Write the output to the console.
// To observe notifications generated by the observable,
// we use a variation of the observe operator (observe, onNext, onComplete, onError)
onNotify(console.log),
// Subscribe to the observable using the normal priority scheduler, creating a subscription.
subscribe(normalPriority);
);