-
Notifications
You must be signed in to change notification settings - Fork 75
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
[Question] Resize Debounce Time #49
Comments
200 is definitely an arbitrary number. It's not clear that just waiting one frame will be enough either though, because the rate at which For clarity on the code, the point of the debounce is to convert a continuously emitted |
After some testing, I've found the Whatever value is chosen will cause a lag if there is a sudden resize event triggered. For instance, opening and closing the dev tools on a desktop browser, or changing the orientation from landscape to portrait (or vice versa) on a mobile app. The view won't update responsively for the duration of 150ms. This is undesirable, however, at least on mobile you can detect for this (because the only resize events from orientation change are discrete in nature). So we can remove any lag on mobile orientation resizes. This has been updated in 4f681de |
Is there a specific reason why the debounce delay is set to 200ms? My assumption is that this is an arbitrary amount of time that is used to ensure the changes are fully reflected in the browser.
My understanding is that the resize event isn't fired by the browser until the resize has actually occurred. So I'm not certain that the delay is necessary, and instead of using
Timer.debounce(fn, 200)
I thinkTimer.debounceAfter(fn, 1)
would be more appropriate.The text was updated successfully, but these errors were encountered: