-
Notifications
You must be signed in to change notification settings - Fork 328
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
Wrap action functions in setTimeout? #22
Comments
strong +1 for this |
I was under the impression they were deferred already. I'm all 👍 for this |
Created PR at #23. Should we bother worrying about using |
I'm pretty sure Should we provide an option for using |
Wouldn't you normally try to run your logic as fast as possible and then batch your UI updates to 60fps? If so, Then again, we can always add |
Here is a nice polyfill for
|
bluebird promise library does something similar: https://github.com/petkaantonov/bluebird/blob/master/src/schedule.js |
I amended my PR to use the |
It's a common use case that action functors are normally tied to virtual DOM event callbacks within components in react.js. EventEmitters (node.js or 3rd-party) are not async in nature, unless otherwise designed to be.
Thus, whenever an emit function is called, it's done synchronously which begin from the action to the store (and chained stores).
Action functors should be executed in fire-and-forget fashion. Thus, I think we should wrap action functions in
setTimeout
with 0ms delay.@spoike thoughts?
The text was updated successfully, but these errors were encountered: