-
-
Notifications
You must be signed in to change notification settings - Fork 715
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Redispatch hangs the browser #382
Comments
I haven't had a chance to fully digest this, but it looks like you're not using |
For the record, here's the docs on what should happen: |
@mike-thompson-day8 that's Double Buffering, @danielcompton |
I'd be happy to jump into the internals and provide a PR if it can make re-frame simpler. |
See binaryage/cljs-devtools#20 (comment) and d49965e. I think this might be what is happening? Can you try removing devtools and see if this still happens? |
@lsenta did this resolve your issue? |
@danielcompton
But the browser still hangs & the console goes unresponsive in both cases. |
Okay, I'm back to this issue after a long absence, sorry. When re-reading, it seems as if this issue is essentially @lsenta proposing:
It is a core assumption in re-frame that only one event at a time is handled. It makes everything every easy to reason about. That isn't going to change. It is a mistake to think of events like "function calls" where one can call another. Closing. |
Hi there, thanks for maintaining this repository, it's always a pleasure to work with re-frame & cljs.
This piece of documentation seems incorrect:
https://github.com/Day8/re-frame/blob/master/docs/Solve-the-CPU-hog-problem.md#why-does-a-redispatch-work
(It should be possible to dispatch an event from another one)
In the case of a simple infinite loop,
I'd expect 100% CPU usage AND the browser to be responsive. This is not the case: the browser / tab / console will hang until I kill it from the task manager.
Using a
setTimeout
solves the issue in this code.Demo repo:
lein figwheel
.test LOOP
button will hang the tab /Authorize mic
will workThe text was updated successfully, but these errors were encountered: