11import { Injectable } from '@angular/core' ;
22import { Actions , Effect < % if ( feature ) { % > , ofType < % } % > } from '@ngrx/effects' ;
3- < % if ( feature && api ) { % > import { catchError , map , concatMap } from 'rxjs/operators' ; < % } % >
4- < % if ( feature && api ) { % > import { EMPTY , of } from 'rxjs' ; < % } % >
5- < % if ( feature && api ) { % > import { Load < %= classify ( name ) % > sFailure , Load < %= classify ( name ) % > sSuccess , < %= classify ( name ) % > ActionTypes , < %= classify ( name ) % > Actions } from '<%= featurePath(group, flat, "actions", dasherize(name)) %><%= dasherize(name) %>.actions' ; < % } % >
6- < % if ( feature && ! api ) { % > import { < %= classify ( name ) % > ActionTypes } from '<%= featurePath(group, flat, "actions", dasherize(name)) %><%= dasherize(name) %>.actions' ; < % } % >
3+ < % if ( feature && api ) { % > import { catchError , map , concatMap } from 'rxjs/operators' ;
4+ import { EMPTY , of } from 'rxjs' ;
5+ import { Load < %= classify ( name ) % > sFailure , Load < %= classify ( name ) % > sSuccess , < %= classify ( name ) % > ActionTypes , < %= classify ( name ) % > Actions } from '<%= featurePath(group, flat, "actions", dasherize(name)) %><%= dasherize(name) %>.actions' ;
6+ < % } % >
7+ < % if ( feature && ! api ) { % > import { concatMap } from 'rxjs/operators' ;
8+ import { EMPTY } from 'rxjs' ;
9+ import { < %= classify ( name ) % > ActionTypes , < %= classify ( name ) % > Actions } from '<%= featurePath(group, flat, "actions", dasherize(name)) %><%= dasherize(name) %>.actions' ;
10+ < % } % >
711
812@Injectable ( )
913export class < %= classify ( name ) % > Effects {
@@ -17,13 +21,16 @@ export class <%= classify(name) %>Effects {
1721 map ( data => new Load < %= classify ( name ) % > sSuccess ( { data } ) ) ,
1822 catchError ( error => of ( new Load < %= classify ( name ) % > sFailure ( { error } ) ) ) )
1923 )
20- ) ;
21- < % } % >
24+ ) ; < % } % >
2225< % if ( feature && ! api ) { % >
2326 @Effect ( )
24- load < %= classify ( name ) % > s$ = this . actions$ . pipe ( ofType ( < %= classify ( name ) % > ActionTypes . Load < %= classify ( name ) % > s ) ) ;
27+ load < %= classify ( name ) % > s$ = this . actions$ . pipe (
28+ ofType ( < %= classify ( name ) % > ActionTypes . Load < %= classify ( name ) % > s ) ,
29+ /** An EMPTY observable only emits completion. Replace with your own observable API request */
30+ concatMap ( ( ) => EMPTY )
31+ ) ;
2532< % } % >
26- < % if ( feature && api ) { % >
33+ < % if ( feature ) { % >
2734 constructor ( private actions$ : Actions << %= classify ( name ) % > Actions > ) { }
2835< % } else { % >
2936 constructor ( private actions$ : Actions ) { }
0 commit comments