Reactive Extensions (Rx) is a library for composing asynchronous and event-based programs using observable sequences and LINQ-style query operators.
Data sequences can take many forms, such as a stream of data from a file or web service, web services requests, system notifications, or a series of events such as user input.
Reactive Extensions represents all these data sequences as observable sequences. An application can subscribe to these observable sequences to receive asynchronous notifications as new data arrive.
RxJS has no dependencies which complements and interoperates smoothly with both synchronous data streams such as iterable objects in JavaScript and single-value asynchronous computations such as Promises as the following diagram shows:
| Single return value | Mutiple return values | |
|---|---|---|
| Pull/Synchronous/Interactive | Object | Iterables (Array | Set | Map | Object) |
| Push/Asynchronous/Reactive | Promise | Observable |
There are a number of ways of getting started with RxJS including:
Getting started with the Reactive Extensions for JavaScript is easy. Let's start with the basics here:
- What are the Reactive Extensions?
- Exploring Major Concepts in RxJS
- Creating and Querying Observable Sequences
- Subjects
- Scheduling and Concurrency
- Testing and Debugging
- Implementing Your Own Operators
There is a large surface area with the Reactive Extensions for JavaScript, so it might be hard to know where to start. This will serve as a guide to answer some of the more basic questions.
Converting your existing code from other libraries can be easy. Many of the concepts you already know from popular libraries such as Bacon.js and Async.js
This section contains the reference documentation for the Reactive Extensions class library.