Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Multiple increments or decrements of the same field don't combine together #16

Open
michaelboyles opened this issue Nov 8, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@michaelboyles
Copy link
Owner

Describe the bug

Multiple increment and decrement operators don't combine together properly. Increment followed by decrement should no-op, but currently the second operation just gets dropped. Multiple increments or decrements in a row should accumulate.

Sample input

interface State {
    val: number;
}
const reducer = redcr((state: State) => {
    state.val++;
    state.val--;
});

Current output

Specify which ES version you're targeting: ES2020

const reducer = (state) => {
    state = {
        ...state,
        str: state.str + 1
    };
    return state;
};
@michaelboyles michaelboyles added the bug Something isn't working label Nov 8, 2021
@michaelboyles michaelboyles self-assigned this Nov 8, 2021
michaelboyles added a commit that referenced this issue Dec 25, 2021
michaelboyles added a commit that referenced this issue Dec 25, 2021
michaelboyles added a commit that referenced this issue Dec 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant