1.2.1 • Published 8 years ago

ng-operators v1.2.1

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

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

1.2.1

8 years ago

1.2.0

8 years ago

1.1.3

9 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.0.0

9 years ago

0.9.0

9 years ago