SHARE
TWEET

Untitled

a guest Oct 23rd, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. })
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top