C
Size: a a a
C
L
L
C
C
С
С
L
L
L
C
L
C
L
L
@Injectable()
export class MyDispacther extends Dispatcher {
constructor( private actions: AppActions ) {
super();
}
next( action: Action ) {
super.next(action);
this.actions.nextAction(action);
}
}
L
@Effect()
getUser = () =>
this.actions$.pipe(
ofType<UserActions>(ActionTypes.RETRIEVE),
switchMap((action: ActionRetrieve) =>
this.service.getUser().pipe(
map((response: any) => new ActionSuccess(response.data)),
catchError(error => of(new ActionError(error))),
takeUntil(
this.actions$.pipe(
ofType<UserActions>(ActionTypes.CANCEL_RETRIEVE)
)
)
)
)
);