Skip to content
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

rAF as default for debounce/throtte (#3560) #3567

Merged
merged 2 commits into from
Jan 1, 2018
Merged

Conversation

mattlubner
Copy link
Contributor

Uses requestAnimationFrame by default (when available on the root object), unless wait is passed as 0 or a truthy value.

This is in reply to #3562, and in turn, #3560.

Feedback is welcome and appreciated. 😀

jacob-beltran and others added 2 commits December 29, 2017 21:27
Adds an additional option to debounce and throttle
if `useRAF` is `true` and `requestAnimationFrame` is available on the `root` object, it will be used for timing instead of `setTimeout()`.

This allows for very smooth and performant throttling of rapid firing events like scroll, resize, etc.
Uses `requestAnimationFrame` by default (when available on the `root` object), unless `wait` is specified.
@jsf-clabot
Copy link

jsf-clabot commented Dec 30, 2017

CLA assistant check
All committers have signed the CLA.

@jacob-beltran
Copy link

Thanks for picking the up @mattlubner
My apologies for not getting back to this. It's a busy time of year.

@jdalton jdalton merged commit d985dbf into lodash:master Jan 1, 2018
@jdalton
Copy link
Member

jdalton commented Jan 1, 2018

Thank you @jacob-beltran and @mattlubner!

@joshbuckley182
Copy link

This doesn't seem to be available in any release at the moment (checked in 4.17.10). Should it be?

@jdalton
Copy link
Member

jdalton commented Apr 25, 2018

Hi @joshbuckley182!

The 4.17.10 bump was just for Node 10 compatibility feature work won't show up until v5.

@lock
Copy link

lock bot commented Apr 25, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

5 participants