@@ -5,7 +5,7 @@ import 'rxjs/add/operator/debounceTime';
5
5
import 'rxjs/add/operator/skip' ;
6
6
import 'rxjs/add/operator/takeUntil' ;
7
7
import { Injectable , InjectionToken , Optional , Inject } from '@angular/core' ;
8
- import { Effect , Actions , toPayload } from '@ngrx/effects' ;
8
+ import { Effect , Actions } from '@ngrx/effects' ;
9
9
import { Action } from '@ngrx/store' ;
10
10
import { Observable } from 'rxjs/Observable' ;
11
11
import { Scheduler } from 'rxjs/Scheduler' ;
@@ -25,12 +25,6 @@ export const SEARCH_SCHEDULER = new InjectionToken<Scheduler>(
25
25
/**
26
26
* Effects offer a way to isolate and easily test side-effects within your
27
27
* application.
28
- * The `toPayload` helper function returns just
29
- * the payload of the currently dispatched action, useful in
30
- * instances where the current state is not necessary.
31
- *
32
- * Documentation on `toPayload` can be found here:
33
- * https://github.com/ngrx/platform/blob/master/docs/effects/api.md#topayload
34
28
*
35
29
* If you are unfamiliar with the operators being used in these examples, please
36
30
* check out the sources below:
@@ -43,9 +37,9 @@ export const SEARCH_SCHEDULER = new InjectionToken<Scheduler>(
43
37
export class BookEffects {
44
38
@Effect ( )
45
39
search$ : Observable < Action > = this . actions$
46
- . ofType ( book . SEARCH )
40
+ . ofType < book . SearchAction > ( book . SEARCH )
47
41
. debounceTime ( this . debounce , this . scheduler || async )
48
- . map ( toPayload )
42
+ . map ( action => action . payload )
49
43
. switchMap ( query => {
50
44
if ( query === '' ) {
51
45
return empty ( ) ;
0 commit comments