Skip to content

lacolaco/ng-operators

Repository files navigation

ng-operators

npm version CircleCI

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

About

RxJS operators for Angular

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published