@@ -4,6 +4,7 @@ import { ofType } from 'redux-observable';
44import { Observable , of , pipe } from 'rxjs' ;
55import objectAssignDeep from 'object-assign-deep' ;
66import { concatMap , mergeMap , map , takeUntil , filter , catchError } from 'rxjs/operators' ;
7+ import { throwError } from 'rxjs' ;
78import { createNotification , NOTIFICATION_TYPE_SUCCESS , NOTIFICATION_TYPE_ERROR } from 'react-redux-notify' ;
89import {
910 receiveData ,
@@ -58,9 +59,9 @@ export const fetchDataEpic = ( action$, state$, { api }) => action$.pipe(
5859 return { response, data } ;
5960 } ) ,
6061 map ( ( payload ) => receiveData ( { name, payload } ) ) ,
61- catchError ( ( error ) => of (
62+ catchError ( ( error ) => of (
63+ createNotification ( { type : NOTIFICATION_TYPE_ERROR , message : error . message } ) ,
6264 cancelRequest ( { name } ) ,
63- createNotification ( { type : NOTIFICATION_TYPE_ERROR , message : error . message } )
6465 ) ) ,
6566 takeUntil ( action$ . pipe (
6667 ofType ( REQUEST_DATA_CANCEL ) ,
@@ -91,8 +92,8 @@ export const deleteDataEpic = ( action$, state$, { api }) => action$.pipe(
9192 ) ;
9293 } ) ,
9394 catchError ( ( error ) => of (
95+ createNotification ( { type : NOTIFICATION_TYPE_ERROR , message : error . message } ) ,
9496 cancelRequest ( { name } ) ,
95- createNotification ( { type : NOTIFICATION_TYPE_ERROR , message : error . message } )
9697 ) )
9798 ) ;
9899 } )
0 commit comments