Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (action$) => {
- return action$.ofType(actionTypes.GET_DATA)
- .mergeMap(action =>
- ajax.getJSON('/api/endpoint', headers)
- .map(response => setData(response))
- .catch(error => Observable.concat(Observable.of({type: actionTypes.REFRESH_TOKEN}, Observable.of({type: actionTypes.GET_DATA}))
- ));
Add Comment
Please, Sign In to add comment