Skip to content

Instantly share code, notes, and snippets.

@datvtwkm
Last active August 31, 2018 11:53
Show Gist options
  • Save datvtwkm/3ce1251dc277a601ea6bc1ede1d607d3 to your computer and use it in GitHub Desktop.
Save datvtwkm/3ce1251dc277a601ea6bc1ede1d607d3 to your computer and use it in GitHub Desktop.
import { createActions } from 'redux-actions';
import groupActions from './groupActions'
const processAction = {
START: ()=>{...},
CANCEL: ()=>{...},
SUCCEED: ()=>{...},
FAIL: ()=>{...},
CLEAR: ()=>{...}
};
const enhancedActions = {};
Object.keys(groupActions).forEach(group => {
enhancedActions[group] = {};
actions[group].forEach(action => {
enhancedActions[group][action] = processAction;
});
});
export default createActions(enhancedActions);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment