Guest User

Untitled

a guest
Feb 23rd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. (action$) => {
  2. return action$.ofType(actionTypes.GET_DATA)
  3. .mergeMap(action =>
  4. ajax.getJSON('/api/endpoint', headers)
  5. .map(response => setData(response))
  6. .catch(error => Observable.concat(Observable.of({type: actionTypes.REFRESH_TOKEN}, Observable.of({type: actionTypes.GET_DATA}))
  7. ));
Add Comment
Please, Sign In to add comment