-
Notifications
You must be signed in to change notification settings - Fork 595
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
Add async counter example #149
Conversation
}, | ||
effects: { | ||
incrementAsync: function (data, state, send, done) { | ||
setTimeout(() => send('increment', done), 1000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey I think you meant to put done
as the third param here. The second param is for data
, which can be null
in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is valid too; data
is optional so is set to null
if not passed.
LGTM 🎉 |
Thanks, @yoshuawuyts feel free to squash and merge when you can :-) |
@sotojuan looks like with the |
The pathname-match module is being required in the pathname element, but wasn't actually included as a dependency.
…model expects exactly 3 arguments
Hey @yoshuawuyts not sure if I did it correctly—I don't mind just closing this PR and submitting another one lol. Really bad at Git. |
@yoshuawuyts Let me know if you can merge ASAP because IDK what I am doing w/ the Git history/rebase anymore ha. Otherwise I don't mind closing and redoing a PR again. |
hah cool yeah let's merge (': |
This is a common example in React/Redux world so it'd be nice to have it for comparison's sake.
In the future I'd like to be able to "cancel" an async increment/decrement such that if the async increment button is clicked, then the cancel button is clicked before the timeout ends,
send('increment', done)
is never called and nothing happens.