Debian Codegraph @

node/rxjs/README.md

raw
1 # <img src="docs_app/src/assets/images/logos/Rx_Logo_S.png" alt="RxJS Logo" width="86" height="86"> RxJS: Reactive Extensions For JavaScript
2
3 ![CI](https://github.com/reactivex/rxjs/workflows/CI/badge.svg)
4 [![npm version](https://badge.fury.io/js/rxjs.svg)](http://badge.fury.io/js/rxjs)
5 [![Join the chat at https://gitter.im/Reactive-Extensions/RxJS](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Reactive-Extensions/RxJS?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
6
7 # The Roadmap from RxJS 7 to 8
8
9 Curious what's next for RxJS? Follow along with [Issue 6367](https://github.com/ReactiveX/rxjs/issues/6367).
10
11 # RxJS 7
12
13 ### FOR 6.X PLEASE GO TO [THE 6.x BRANCH](https://github.com/ReactiveX/rxjs/tree/6.x)
14
15 Reactive Extensions Library for JavaScript. This is a rewrite of [Reactive-Extensions/RxJS](https://github.com/Reactive-Extensions/RxJS) and is the latest production-ready version of RxJS. This rewrite is meant to have better performance, better modularity, better debuggable call stacks, while staying mostly backwards compatible, with some breaking changes that reduce the API surface.
16
17 [Apache 2.0 License](LICENSE.txt)
18
19 - [Code of Conduct](CODE_OF_CONDUCT.md)
20 - [Contribution Guidelines](CONTRIBUTING.md)
21 - [Maintainer Guidelines](docs_app/content/maintainer-guidelines.md)
22 - [API Documentation](https://rxjs.dev/)
23
24 ## Versions In This Repository
25
26 - [master](https://github.com/ReactiveX/rxjs/commits/master) - This is all of the current work, which is against v7 of RxJS right now
27 - [6.x](https://github.com/ReactiveX/rxjs/tree/6.x) - This is the branch for version 6.X
28
29 Most PRs should be made to **master**.
30
31 ## Important
32
33 By contributing or commenting on issues in this repository, whether you've read them or not, you're agreeing to the [Contributor Code of Conduct](CODE_OF_CONDUCT.md). Much like traffic laws, ignorance doesn't grant you immunity.
34
35 ## Installation and Usage
36
37 ### ES6 via npm
38
39 ```shell
40 npm install rxjs
41 ```
42
43 It's recommended to pull in the Observable creation methods you need directly from `'rxjs'` as shown below with `range`.
44 If you're using RxJS version 7.2 or above, you can pull in any operator you need from the same spot, `'rxjs'`.
45
46 ```ts
47 import { range, filter, map } from 'rxjs';
48
49 range(1, 200)
50 .pipe(
51 filter(x => x % 2 === 1),
52 map(x => x + x)
53 )
54 .subscribe(x => console.log(x));
55 ```
56
57 If you're using RxJS version below 7.2, you can pull in any operator you need from one spot, under `'rxjs/operators'`.
58
59 ```ts
60 import { range } from 'rxjs';
61 import { filter, map } from 'rxjs/operators';
62
63 range(1, 200)
64 .pipe(
65 filter(x => x % 2 === 1),
66 map(x => x + x)
67 )
68 .subscribe(x => console.log(x));
69 ```
70
71 ### CDN
72
73 For CDN, you can use [unpkg](https://unpkg.com/):
74
75 [https://unpkg.com/rxjs@^7/dist/bundles/rxjs.umd.min.js](https://unpkg.com/rxjs@%5E7/dist/bundles/rxjs.umd.min.js)
76
77 The global namespace for rxjs is `rxjs`:
78
79 ```js
80 const { range } = rxjs;
81 const { filter, map } = rxjs.operators;
82
83 range(1, 200)
84 .pipe(
85 filter(x => x % 2 === 1),
86 map(x => x + x)
87 )
88 .subscribe(x => console.log(x));
89 ```
90
91 ## Goals
92
93 - Smaller overall bundles sizes
94 - Provide better performance than preceding versions of RxJS
95 - To model/follow the [Observable Spec Proposal](https://github.com/zenparsing/es-observable) to the observable
96 - Provide more modular file structure in a variety of formats
97 - Provide more debuggable call stacks than preceding versions of RxJS
98
99 ## Building/Testing
100
101 - `npm run compile` build everything
102 - `npm test` run tests
103 - `npm run dtslint` run dtslint tests
104
105 ## Adding documentation
106
107 We appreciate all contributions to the documentation of any type. All of the information needed to get the docs app up and running locally as well as how to contribute can be found in the [documentation directory](./docs_app).