Last active
August 31, 2018 11:53
-
-
Save datvtwkm/3ce1251dc277a601ea6bc1ede1d607d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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