mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-11-07 13:42:02 +08:00
If we attempt to schedule a component render when one had already been scheduled, we currently follow with a second render when the first has finished. Effectively we *mostly* debounce, i.e., if you attempt to schedule 20 calls before the first has started, we'll do 2 renders. This CL updates the logic to a two-step one. In the first instance, a render callback is placed in a pending set, such that if we receive any more schedule calls when the first is pending we ignore them. If the callback has started, however, we do schedule a follow-up render. R=jacktfranklin@chromium.org Bug: 1209820 Change-Id: I4b31d7d6d6e4778132d6a2b360ed2a8904d7f69a Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2902822 Commit-Queue: Paul Lewis <aerotwist@chromium.org> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>