Closed michaelboyles closed 2 years ago
After the fix, generated code looks like:
const reducer = (state) => {
state = {
...state,
arr: [...state.arr]
};
return state;
};
The spreads are unnecessary but can be improved later. Ticket to remove the unnecessary spreads is here: #7
Describe the bug
If multiple array functions are called on the same field, all of them except the first call are dropped on the floor. In the example below, the result is the same as if the array pop wasn't there.
This reducer should probably no-op (and maybe warn?), but currently it will push the number 123.
Sample input
Current output
Specify which ES version you're targeting: ES2020