Skip to main content

Reactive JS:

Fast modern reactive Javascript programming library

Example Usage

import { pipe } from "@reactive-js/pipe";
import {
  exhaust,
  fromArray,
  generate,
  map,
  onNext,
  subscribe
} from "@reactive-js/rx";
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).
  onNext(console.log),

 // Subscribe to the observable using the normal priority scheduler, creating a subscription.
 subscribe(normalPriority);
);

Packages

Reactive Asynchronous Programming (RX)

Interactive Asynchronous Programming (IX)

Schedulers

Utilities

Platform Integrations

Node.js

React

Web