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.
Version | Release date |
---|---|
RxJS 4 | 2015-09-25 |
RxJS 5 | 2016-12-13 |
RxJS 5.0.1 | 2016-12-13 |
RxJS 5.1.0 | 2017-02-01 |
<!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>
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