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