Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
globalScope.__REACT_ASYNC__.devToolsDispatcher = (action, dispatch) => {
const run = () => {
dispatch(action)
state.update(action)
}
switch (action.type) {
case ActionTypes.start:
if (state.intercept) {
dispatch({ ...action, payload: undefined })
state.update(action, run)
} else run()
break
case ActionTypes.fulfill:
case ActionTypes.reject:
setTimeout(run, state.latency * 1000)
break
default:
run()
}
}