ng-operators
v1.2.1
Published
RxJS operators for Angular
Downloads
9
Readme
ng-operators
RxJS operators for Angular
Install
$ npm install --save ng-operators
Usage
- 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(...);
Operators
mapToResponseJson<R>
- Input:
Observable<http.Response>
- Output:
Observable<R>
A shorthand of .map(resp => resp.json() as R)
mapToResponseText
- Input:
Observable<http.Response>
- Output:
Observable<string>
A shorthand of .map(resp => resp.text())
onNavigationEnd
- Input:
Observable<router.Event>
- Output:
Observable<router.NavigationEnd>
A shorthand of .filter(e => e instanceof NavigationEnd)
License
MIT