bsorrentino
1/21/2017 - 7:52 AM

Reduce bundle size with RxJS patching

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));