Use action from actionCreator
This commit is contained in:
@ -1,14 +1,11 @@
|
|||||||
|
import { makeToast } from '../../common/app/toasts/redux/actions';
|
||||||
|
|
||||||
export default function errorSaga(action$) {
|
export default function errorSaga(action$) {
|
||||||
return action$
|
return action$
|
||||||
.filter(({ error }) => !!error)
|
.filter(({ error }) => !!error)
|
||||||
.map(({ error }) => error)
|
.map(({ error }) => error)
|
||||||
.doOnNext(error => console.error(error))
|
.doOnNext(error => console.error(error))
|
||||||
.map(() => ({
|
.map(() => makeToast({
|
||||||
type: 'app.makeToast',
|
message: 'Something went wrong, please try again later'
|
||||||
payload: {
|
|
||||||
type: 'error',
|
|
||||||
title: 'Oops, something went wrong',
|
|
||||||
message: 'Something went wrong, please try again later'
|
|
||||||
}
|
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user