I am using ngrx stores and calling an API inside effects and I want to get the error in the subcription of one action if api fails
example
this.store.pipe(select(economicEntriesReducer.getEconomicEntries)).subscribe(
(response) => { // getting response here if api in effect is successful}
(error) => { // how do i make it work });
I am returning the state from reducers
export const getEconomicSupplierGroups = createSelector( getEconomicEntriesState, state => { return state; } );
and handing the call like this in effects
return this.httpService.get('economic/entries').pipe(map(
(response: Supplier[]) => {
return new economicEntriesActions.GetEntriesSuccess(<Supplier[]>response);
}),
catchError(error => of(new economicEntriesActions.GetEntriesError(error)))
);