Skip to content

Instantly share code, notes, and snippets.

@bsorrentino
Forked from ericelliott/rxjs-patching.js
Created January 21, 2017 07:52
Show Gist options
  • Save bsorrentino/dded2036505fc9db30938a0e4bed522b to your computer and use it in GitHub Desktop.
Save bsorrentino/dded2036505fc9db30938a0e4bed522b 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