Open michaelboyles opened 2 years ago
When executing array operations which are the inverse of another such as
interface NumberArrayState { arr: number[] } const reducer = redcr((state: NumberArrayState) => { state.arr.push(123); state.arr.pop(); });
The generated code looks like this:
const reducer = (state) => { state = { ...state, arr: [...state.arr] }; return state; };
Both the ...state.arr spread and the ...state spread are pointless. It would be better if Redcr was smart enough to just remove them
...state.arr
...state
When executing array operations which are the inverse of another such as
The generated code looks like this:
Both the
...state.arr
spread and the...state
spread are pointless. It would be better if Redcr was smart enough to just remove them