revery
revery copied to clipboard
Problem with State update with interval
- Operating System: macOS 10.15
- Revery Version: 0.29
- OCaml version: version 4.06.1
-
Link to github repo: https://github.com/czystyl/revery-tick-issues
-
Actual Result: The repro contains a short video as well.
I used setInterval to update the component state each 50 ms. The counter from the hook state was not updating every 50ms but much slower than expected. However, when we start moving the mouse over the app, or we use press/hold key from the keyboard, then the counter is incrementing much faster than before.
- Search terms used: timer, set interval, counter
If you set canIdle
to be false then this problem disappears.
Is it worth doing let evt = Sdl2.Event.waitTimeout(250);
in the main loop just to save the if
statement checking if it should shift into the active state or not?