UNPKG

generator-genreact

Version:

A batteries-included isomorphic react application generator.

12 lines (10 loc) 385 B
import defaultState from 'store/defaultState'; import * as <%= actionFile %> from '<%= actionFile %>'; export default function <%= toFunc(name) %>(state = defaultState.<%= toFunc(name) %>, action) { switch (action.type) {<% actions.forEach(function(action) { %> case <%= actionFile %>.<%= toConst(action) %>: return action.payload;<% }); %> default: return state; } }