Here are different ways you can install RxJS:
npm install rxjs
By default, RxJS 7.x will provide different variants of the code based on the consumer:
require or import, CommonJS code targeting ES5 will be provided for execution.If the target browsers for a project support ES2015+ or the bundle process supports down-leveling to ES5 then the bundler can optionally be configured to allow the ES2015 RxJS code to be used instead. You can enable support for using the ES2015 RxJS code by configuring a bundler to use the es2015 custom export condition during module resolution. Configuring a bundler to use the es2015 custom export condition is specific to each bundler. If you are interested in using this option, please consult the documentation of your bundler for additional information. However, some general information can be found here:
To import only what you need, please check out this guide.
If you receive an error like error TS2304: Cannot find name 'Promise' or error TS2304: Cannot find name 'Iterable' when using RxJS you may need to install a supplemental set of typings.
typings install es6-shim --ambient
If you're not using typings the interfaces can be copied from /es6-shim/es6-shim.d.ts.
Add type definition file included in tsconfig.json or CLI argument.
To install this library via npm version 3, use the following command:
npm install @reactivex/rxjs
If you are using npm version 2, you need to specify the library version explicitly:
npm install @reactivex/[email protected]
For CDN, you can use unpkg:
https://unpkg.com/rxjs@^7/dist/bundles/rxjs.umd.min.js
To import what you need, please check out this guide.
© 2015–2022 Google, Inc., Netflix, Inc., Microsoft Corp. and contributors.
Code licensed under an Apache-2.0 License. Documentation licensed under CC BY 4.0.
https://rxjs.dev/guide/installation