rxjs Getting started with rxjs

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Remarks

This section provides an overview of what rxjs is, and why a developer might want to use it.

It should also mention any large subjects within rxjs, and link out to the related topics. Since the Documentation for rxjs is new, you may need to create initial versions of those related topics.

Versions

VersionRelease date
RxJS 42015-09-25
RxJS 52016-12-13
RxJS 5.0.12016-12-13
RxJS 5.1.02017-02-01

Installation or Setup

Using a CDN:

<!DOCTYPE html>
<head>
  <script src="https://cdn.jsdelivr.net/rxjs/4.1.0/rx.min.js"></script>
</head>
<body>

  <script>
    // `Rx` is available
    var one$ = Rx.Observable.of(1);
    var onesub = one$.subscribe(function (one) {
      console.log(one); // 1
    });
    // alternatively: subscribe(console.log)
  </script>
</body>
</html>
 

CDN if using RxJS 5 (RC):

<script src="https://npmcdn.com/@reactivex/[email protected]/dist/global/Rx.js"></script>
 

Using a bundler:

First install into your project directory with npm:

npm install rx
 

Or using RxJS 5 (RC):

npm install rxjs
 

Then, in your JavaScript file:

var Rx = require('rx');
//var Rx = require('rxjs/Rx'); // v5beta 

var one$ = Rx.Observable.of(1);
var onesub = one$.subscribe(function (one) {
  console.log(one); // 1
});
 

If using an es6/2015 compatible bundler:

import Rx from 'rx';
//import Rx from 'rxjs/Rx'; // v5beta

const one$ = Rx.Observable.of(1);
const onesub = one$.subscribe(one => console.log(one)); // 1
 


Got any rxjs Question?