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

makeDuck should also return a resetReducer #12

Open
monteslu opened this issue Apr 24, 2020 · 0 comments
Open

makeDuck should also return a resetReducer #12

monteslu opened this issue Apr 24, 2020 · 0 comments

Comments

@monteslu
Copy link
Member

monteslu commented Apr 24, 2020

Instead of import { resetReducer } from cooldux :

export const { someAction, someOtherAction, initialStateCombined } = duck;

const reducer = resetReducer(initialStateCombined, (state = initialStateCombined, action) => {
  return duck.reducerCombined(state, action);
});

export default reducer;

It should be as simple as:

export const { someAction, someOtherAction } = duck;

export default duck.resetReducer;

you can still the former example if you need custom reducer functionality. Just finding myself using the same reset pattern too often

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

1 participant