Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standard Reducer function should be made common #15

Open
michael-martin opened this issue Jul 29, 2016 · 1 comment
Open

Standard Reducer function should be made common #15

michael-martin opened this issue Jul 29, 2016 · 1 comment

Comments

@michael-martin
Copy link
Contributor

This chunk of code can be re-used across all Ducks files. Should be generated by an imported function, which is passed the appropriate REDUCERS object to use.

export default function reducer (state = initialState, action = {}) {
  const handler = REDUCERS[action.type];
  return handler ? handler(state, action) : state;
};
@vitkon
Copy link
Contributor

vitkon commented Aug 8, 2016

I like the idea, but then do you have to add REDUCERS into the function signature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants