Skip to content
Myr

docs: add `break` to `switch` block (#769)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

I get that there's only one `case` here but for people plucking this example and then using it to build out their own reducer, they'll immediately run into issues as soon as they add a second `case` with no `break` in the first.

authored by Greg Venech · committed by GitHub · parent 5ae3547 · Browse files · 1 file+1 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−0 removed

  • other:+1 added−0 removed

1 file+1 added−0 removed

modified:website/docs/example-reducer.mdx+1 added
65 unmodified lines
66 case RECEIVE_PRODUCTS:67 action.products.forEach(product => {68 draft[product.id] = product69 })70 break71 }72}, INITIAL_STATE)73```74
5 unmodified lines