const reducer = (state = {}, action) => {
switch (action.type) {
case 'THING':
return { ...state, thing: action.nonexistent.childprop }
default:
return state;
}
};
export function sampleEpic(action$: Observable, store: Store) {
return action$.ofType(ANYTHING)
.concatMap(action =>
fetch('/api/anything', { ... })
.mergeMap(response => {
switch (response.status) {
case 409:
return Observable.of(pleaseNo(email));
case 201:
return Observable.of({ type: 'THING' }, { type: 'NEVER_DISPATCHED' });
default:
throw new Error(`Unknown response code ${response.code}`);
}
});
}
The THING action causes a crash that is hidden from the user (me for the last 2 hours) so that it's very hard to see where things went wrong.
Adding catch to the end of the epic doesn't make a difference.
All middleware a successfully run.
The THING action causes a crash that is hidden from the user (me for the last 2 hours) so that it's very hard to see where things went wrong.
Adding
catchto the end of the epic doesn't make a difference.All middleware a successfully run.