Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import {addRule} from 'redux-ruleset'
- addRule({
- id: 'FETCH_DATA',
- target: 'FETCH_DATA_REQUEST',
- concurrency: 'SWITCH',
- consequence: () => api.fetchData().then(
- result => ({ type: 'FETCH_DATA_SUCCESS', payload: result }),
- error => ({ type: 'FETCH_DATA_FAILURE', payload: error.toString() })
- )
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement