Created
December 10, 2016 00:35
-
-
Save ericelliott/827f9628a8e032645df991d9f1e2140f to your computer and use it in GitHub Desktop.
Reduce bundle size with RxJS patching
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Observable } from 'rxjs/Observable'; | |
// then patch import only needed operators: | |
import 'rxjs/add/operator/map'; | |
import 'rxjs/add/observable/from'; | |
const foo = Observable.from([1, 2, 3]); | |
foo.map(x => x * 2).subscribe(n => console.log(n)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment