Need private packages and team management tools?Check out npm Teams »

ngrx-tslint-oftype

0.0.2 • Public • Published

NgRx TSLint

TSLint rules for NgRx. Heavily based on ReactiveX/rxjs-tslint

Table of Contents

Rules

ngrx-effects-operators

Migrates the ofType function to its pipeable equivalent.

BEFORE:
import { Effect, Actions } from '@ngrx/effects';
 
@Effect()
search = this.actions.ofType<SearchAnimals>(SEARCH_ANIMALS).pipe(
    debounceTime(3000),
    switchMap(...),
  );
 
AFTER:
import { Effect, Actions, ofType } from '@ngrx/effects';
 
@Effect()
search = this.actions.pipe(
    ofType<SearchAnimals>(SEARCH_ANIMALS),
    debounceTime(3000),
    switchMap(...),
  );

ngrx-chained-pipes

Because the rules above will create a new pipe chain you may end up with multiple pipes, this rule will combine both pipe chains.

BEFORE:
this.store.pipe(select(...)).pipe(map(...))
 
AFTER:
this.store.pipe(select(...), map(...))

Usage

{
  "rulesDirectory": ["node_modules/ngrx-tslint-oftype"],
  "rules": {
    "ngrx-effects-operators": true,
    "ngrx-chained-pipes": true
  }
}

License

MIT

Install

npm i ngrx-tslint-oftype

DownloadsWeekly Downloads

50

Version

0.0.2

License

MIT

Unpacked Size

24.8 kB

Total Files

16

Last publish

Collaborators

  • avatar