Skip to content

Instantly share code, notes, and snippets.

@ericelliott
Created December 10, 2016 00:35
Show Gist options
  • Save ericelliott/827f9628a8e032645df991d9f1e2140f to your computer and use it in GitHub Desktop.
Save ericelliott/827f9628a8e032645df991d9f1e2140f to your computer and use it in GitHub Desktop.
Reduce bundle size with RxJS patching
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