RxJS Lite (Legacy v4)

4.0.8 · abandoned · verified Tue Apr 21

rx-lite is a lightweight distribution of the Reactive Extensions for JavaScript (RxJS) version 4.x, primarily used for composing asynchronous and event-based operations in JavaScript. At version 4.0.8, it provided a core set of observable operators for handling events, promises, callbacks, and time-based operations in both modern browser environments (IE9+) and Node.js. The library was part of an earlier generation of RxJS, with its development repository transitioning to 'RxJS vNext' (which became RxJS v5 and later) after the 4.x series. This version prioritizes a compact bundle (`rx.lite.js`) for everyday use cases, differing from the more modular, tree-shakable approach adopted in subsequent major RxJS releases. It had an irregular release cadence, focusing on bug fixes and performance improvements within the 3.x and 4.x lines before the major architectural shift to modern RxJS.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates creating an observable from an array, applying map and filter operators, and subscribing to log values. Also shows converting a Promise to an Observable.

const Rx = require('rx-lite');

const source = Rx.Observable.fromArray([1, 2, 3, 4, 5]);

const subscription = source
  .map(x => x * 2)
  .filter(x => x > 5)
  .subscribe(
    x => console.log('Next: ' + x),
    err => console.error('Error: ' + err),
    () => console.log('Completed')
  );

// Example with a promise
const somePromise = Promise.resolve('Hello from Promise!');
Rx.Observable.fromPromise(somePromise)
  .subscribe(
    data => console.log('Promise data: ' + data),
    err => console.error('Promise error: ' + err)
  );

// To stop listening (important for long-lived observables)
// subscription.dispose();

view raw JSON →