Use action from actionCreator

pull/11244/head
Mahatthana Nomsawadi 2016-10-16 12:28:03 +07:00
parent 96f5b3a2af
commit 3a17fc16c8
1 changed files with 4 additions and 7 deletions

View File

@ -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'
}));
}