-
Notifications
You must be signed in to change notification settings - Fork 16
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
upcastingReducer
example doesn't show the need for an initial state
#26
Comments
Hi @dcurletti, thanks very much for opening this issue. You're totally right that the example is broken. I have some somewhat rambling thoughts about how to handle it. I think this is a docs problem, not a library problem. The only thing wrong with the upcasting reducer example is that the I'm not sure that giving
You might ask, why have Because of this, despite the typings around Back to the original point: as |
Will leave a longer response as to why tomorrow, but I agree that upcastingReducer shouldn't take an initial state. Yea, sorry, I should've been more explicit that this was only a docs problem. |
The example in the Readme of the
upcastingReducer
doesn't show that the final "reducer" should have an initial state passed to it in order for it not to error.Reason: someone copy and pasting that example and exporting the final function as the reducer will get an error when they try to run the code or test it.
I can submit a PR for this later today, but the fix is just creating an
INITIAL_STATE
variable that is given as the default to the final "reducer".The text was updated successfully, but these errors were encountered: