File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { Injectable, Inject } from '@angular/core';
2
2
import { Action , ScannedActionsSubject } from '@ngrx/store' ;
3
3
import { Observable } from 'rxjs/Observable' ;
4
4
import { Operator } from 'rxjs/Operator' ;
5
- import { filter } from 'rxjs/operator/filter ' ;
5
+ import { filter } from 'rxjs/operators ' ;
6
6
import { OperatorFunction } from 'rxjs/interfaces' ;
7
7
8
8
@Injectable ( )
@@ -23,14 +23,12 @@ export class Actions<V = Action> extends Observable<V> {
23
23
}
24
24
25
25
ofType < V2 extends V = V > ( ...allowedTypes : string [ ] ) : Actions < V2 > {
26
- return ofType < any > ( ...allowedTypes ) ( this as Actions < any > ) ;
26
+ return ofType < any > ( ...allowedTypes ) ( this as Actions < any > ) as Actions < V2 > ;
27
27
}
28
28
}
29
29
30
30
export function ofType < T extends Action > ( ...allowedTypes : string [ ] ) {
31
- return function ofTypeOperator ( source$ : Actions < T > ) : Actions < T > {
32
- return filter . call ( source$ , ( action : Action ) =>
33
- allowedTypes . some ( type => type === action . type )
34
- ) ;
35
- } ;
31
+ return filter ( ( action : Action ) : action is T =>
32
+ allowedTypes . some ( type => type === action . type )
33
+ ) ;
36
34
}
Original file line number Diff line number Diff line change @@ -51,7 +51,6 @@ describe('Container Schematic', () => {
51
51
appTree . create ( '/src/app/reducers' , '' ) ;
52
52
const tree = schematicRunner . runSchematic ( 'container' , options , appTree ) ;
53
53
const content = getFileContent ( tree , '/src/app/foo/foo.component.ts' ) ;
54
- console . log ( content ) ;
55
54
expect ( content ) . toMatch ( / i m p o r t \ { \ S t o r e \ } \ f r o m \ ' @ n g r x \/ s t o r e ' ; / ) ;
56
55
} ) ;
57
56
You can’t perform that action at this time.
0 commit comments