const dispatchOnError = ( actionCreator, returnValue, ) => ( catchError(( error, ) => { dispatch( actionCreator( error, ) ) return ( returnValue ? of(returnValue) : EMPTY ) }) )