wismer/dm-tool

DRY up actions

Opened this issue · 2 comments

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 is that similar to

import * as actions from './actions';