DRY up actions
Opened this issue · 2 comments
Will-Sommers commented
One thing we do in our app is something like this
_.reduce([ "ACTION_ONE",
"ACTION_TWO",
"ACTION_THREE"], function(action, memo) {
memo[action] = action;
return memo;
}, {})
http://underscorejs.org/#reduce
We then put all of our actions in a single file and export it. In most big apps, this might not make sense but we don't have that many actions.
Will-Sommers commented
This might help with the readability of this file: https://github.com/wismer/dm-tool/blob/master/src/redux/actions.ts#L117
wismer commented
@Will-Sommers is that similar to
import * as actions from './actions';