-
Notifications
You must be signed in to change notification settings - Fork 7
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
Wrong counter action function in react-trrack-example #15
Labels
bug
Something isn't working
Comments
Changing the functions to the const incrementCounter = reg.register(
'increment-counter',
(add: number) => {
setCounter((c) => c + add);
return {
undo: {
type: 'decrement-counter',
payload: add,
},
};
}
);
const decrementCounter = reg.register(
'decrement-counter',
(sub: number) => {
setCounter((c) => c - sub);
return {
undo: {
type: 'increment-counter',
payload: sub,
},
};
}
); However, now I see runtime errors when I click the increment/decrement button.
Initial state: After clicking the counter button: It looks like the tasks property is removed from the initial state with the counter methods. How does a valid counter action function look like? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Steps to reproduce
yarn dev:all
Observed behavior
The action functions for
incrementCounter
anddecrementCounter
are probably not up-to-date with the most recent typings.Expected behavior
The examples should compile without errors.
The text was updated successfully, but these errors were encountered: