Skip to content
This repository has been archived by the owner on Jul 17, 2020. It is now read-only.

lxsmnsyc/reactive-extensions

Repository files navigation

reactive-extensions

Reactive Extensions for JS

All Observables are extended in this package to allow observable conversion, and other features.

Installation

  • NPM
npm i reactive-extensions
  • CDN

    • jsDelivr
    <script src="https://cdn.jsdelivr.net/npm/is-reactive-streams/dist/index.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/rx-cancellable/dist/index.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/rx-scheduler/dist/index.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/rx-maybe/dist/index.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/rx-single/dist/index.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/rx-completable/dist/index.min.js"></script>
    • unpkg
    <script src="https://unpkg.com/is-reactive-streams/dist/index.min.js"></script>
    <script src="https://unpkg.com/rx-cancellable/dist/index.min.js"></script>
    <script src="https://unpkg.com/rx-scheduler/dist/index.min.js"></script>
    <script src="https://unpkg.com/rx-maybe/dist/index.min.js"></script>
    <script src="https://unpkg.com/rx-single/dist/index.min.js"></script>
    <script src="https://unpkg.com/rx-completable/dist/index.min.js"></script>

Difference between reactive-extensions and RxJS

There is already an existing ReactiveX implementation in JS called RxJS. reactive-extensions does not intend to replace RxJS, as this library was meant for educational purposes but evolved into a library that can be used for production. You can use either of two, but both libraries does not interop with one another.

Below is the comparison table between reactive-extensions and RxJS

Behavior reactive-extensions RxJS
Code Written in pure JavaScript. Written in TypeScript.
Observable Extensions Supports Maybe, Single, Completable and Flowable None
Operator Composition Can both wrap the Emitter (through compose) and the Observer (through lift). Wraps the Subscriber.
Operators Bundled with their respective classes. Other operators returns a different type of Observable. Exportable as an individual module.
Pipelines Using compose. Using pipe
Subscription Uses Cancellable and Subscription (Flowable only) Uses the Subscription class.
TC39 Observable No. Yes.
Performance needs testing needs testing

Useful Links