Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function dispatchRemotely(action, instance) {
try {
const { store, actionCreators } = instance;
const result = evalAction(action, actionCreators);
store.dispatch(result);
} catch (e) {
relay('ERROR', e.message, instance);
}
}
dispatchRemotely(action) {
try {
const result = evalAction(action, this.actionCreators);
this.store.dispatch(result);
} catch (e) {
this.relay('ERROR', e.message);
}
}