{ EntryResource } from './entry.resource'; @Injectable() export class EntryEffects { @Effect() start$: Observable<Action> = this.actions$.pipe( ofType<entry.Start>(entry.START), switchMap(({ payload }) => this.er.start(payload).pipe( map(payload => new entry.Started(payload)), catchError(err => of(new entry.Error(err))) ) ) ); constructor(private actions$: Actions, private er: EntryResource) { } } this.er.start(payload).pipe( map(payload => new entry.Started(payload)), catchError(err => of(new entry.Error(err))) )