-
-
Notifications
You must be signed in to change notification settings - Fork 15.2k
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
add createReducer for redux #3210
Comments
Reducers are just a pure function that takes state and an account and returns the new state. Many are implemented as switch statements, but they aren't necessary to every implementation. So, making that part of the default library is a bit too prescriptive. However, we are looking into boilerplate reduction and other tooling to get users started quickly here: #2859 |
More specifically, we've already added this to our new https://github.com/reduxjs/redux-starter-kit package. Our version also uses Immer internally to allow users to simplify their immutable update logic considerably. Try it out! |
@markerikson yeah cool I found it! it perfect, thanks!. |
@markerikson do you know if you are planning to add tests coverage to reduxjs/redux-starter-kit ? |
Looks like we've got a few tests in there, but there might be some more that could help. Also see the list of open issues. |
Cool thanks! |
Motivation
as mention in docs: "since many people don't like switch statements, it's very common to use a function that creates a lookup table of action types to case functions. We'll use the createReducer function described in Reducing Boilerplate." reference
I suggest to add createReducer for redux, it very common usage and it leads developers to implement redux with better good practice. sure we also need to add for documentation.
it pretty same as combineReducer utils that is common usage, and redux expose that helper.
Benefits
what are you thinking ?
The text was updated successfully, but these errors were encountered: