Skip to content

debounce/shouldUpdate refactor

Compare
Choose a tag to compare
@alfrdmalr alfrdmalr released this 03 Dec 18:48

FIXED: Issue where applying movingTarget at the Tour level would cause stuttering/glitchy behavior due to desynced update calls.

Changed debounce to behave more like a traditional debounce: subsequent calls postpone the debounced function until a certain time has passed without any calls being made. This is similar to how certain browsers handle their resize events.

Also refactored shouldUpdate by breaking it into two pieces - shouldScroll and targetChanged - to allow that logic to be reused where needed.