Skip to main content
Deno 2 is finally here 🎉️
Learn more

Reactive JS:

Fast modern reactive Javascript programming library

Example Usage

import { connect } from "@reactive-js/rx";
import {
  exhaust,
  fromArray,
  generate,
  map,
  onNext,
} from "@reactive-js/observable";
import { pipe } from "@reactive-js/pipe";
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),

  // Connect the observable to a scheduler, creating a subscription.
// In reactive-js, we never directly create a Subscriber, but instead
// use the connect function.
 connect(normalPriority);
);

Packages

Reactive Asynchronous Programming (RX)

Interactive Asynchronous Programming (IX)

Schedulers

Resource Management

Platform Integrations

Node.js

React

Web

RxJS/TC39 Comparison