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

According to Redux docs, reducers should be free of side-effects #28

Open
onionpeel opened this issue Oct 18, 2019 · 0 comments
Open

According to Redux docs, reducers should be free of side-effects #28

onionpeel opened this issue Oct 18, 2019 · 0 comments

Comments

@onionpeel
Copy link

Brad,
Thanks for educating the coding masses! I can't imagine were I would be without having you walk me through the steps needed to build MERN apps.

You have all of the localStorage method calls inside of the reducers. While this works, Redux suggests not producing side-effects from reducers. I put them inside of the action creators (which I think is where they are supposed to be) and things work as expected.
https://redux.js.org/glossary#reducer

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