Documentation bug
Example code at https://redux.js.org/basics/reducers has switch statements without breaks.
What is the current behavior?
The actual behaviour of the example code is that nothing happens for any given action - the execution flows all the way through to the default case no matter what action is supplied.
What is the expected behavior?
With break statements added, the correct action is applied to the reducer. That means the state correctly changes after each action is dispatched.
Which versions of Redux, and which browser and OS are affected by this issue? Did this work in previous versions of Redux?
This is just a minor javascript mistake, so hopefully versions are not relevant. I have never submitted a pull request before, so I thought I'd bring up the issue here first. Should I supply a pull request with a fix for the problem?
Thanks!
The switch cases all use return statements, so a break isn't necessary.
Ah yes. I changed the code to assign a variable instead of returning while I was playing with it, and then forgot about it. Sorry about that!
Most helpful comment
The switch cases all use return statements, so a break isn't necessary.