Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. import {addRule} from 'redux-ruleset'
  2.  
  3. addRule({
  4. id: 'FETCH_DATA',
  5. target: 'FETCH_DATA_REQUEST',
  6. concurrency: 'SWITCH',
  7. consequence: () => api.fetchData().then(
  8. result => ({ type: 'FETCH_DATA_SUCCESS', payload: result }),
  9. error => ({ type: 'FETCH_DATA_FAILURE', payload: error.toString() })
  10. )
  11. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement