RxJS operators for Angular
$ npm install --save ng-operators
- Import all operators
import 'ng-operators/add/all';
response$.mapToResponseJson().subscribe(...);
- Import single operator
import 'ng-operators/add/mapToResponseJson';
response$.mapToResponseJson().subscribe(...);
- Import single operator as a function
import { mapToResponseJson } from 'ng-operators';
mapToResponseJson.call(response$).subscribe(...);
- Input:
Observable<http.Response>
- Output:
Observable<R>
A shorthand of .map(resp => resp.json() as R)
- Input:
Observable<http.Response>
- Output:
Observable<string>
A shorthand of .map(resp => resp.text())
- Input:
Observable<router.Event>
- Output:
Observable<router.NavigationEnd>
A shorthand of .filter(e => e instanceof NavigationEnd)
MIT