Reactive JS:
Fast modern reactive Javascript programming library
Example Usage
import {
connect,
exhaust,
fromArray,
generate,
map,
onNext,
pipe,
} from "@reactive-js/observable";
import { normalPriority } from "@reactive-js/react-scheduler";
// The pipe function can be used to compose operators.
const observable = 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).
onNext(console.log),
);
// Connect the observable to a scheduler, creating a subscription.
// In reactive-js, we never directly create a Subscriber, but instead
// use the connect function.
const subscription = connect(observable, normalPriority);