Nitpick about example code
Closed this issue · 2 comments
winkler1 commented
Hi-
Cool project. One concern about the sample code...does not really matter, but it's triggering my ocd--
const reducer = (state = initState, { type, payload }) => {
let newState;
switch (type) {
case 'INCREMENT':
case 'DECREMENT':
newState = payload;
break;
default:
newState = state;
}
return newState;
}
... the actions are not really incrementing or decrementing, just copying the payload... so it's not really a good test because the state is replaced each time. Could the example really increment/decrement?
Thanks
conorhastings commented
@winkler1 yup you're correct, i've update the README and the code in the demo, thanks!
winkler1 commented
👍