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

Use requestIdleCallback #190

Open
schorfES opened this issue Aug 17, 2021 · 2 comments
Open

Use requestIdleCallback #190

schorfES opened this issue Aug 17, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@schorfES
Copy link
Owner

schorfES commented Aug 17, 2021

Use requestIdleCallback instead of debounce. See: https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback

@schorfES schorfES added enhancement New feature or request good first issue Good for newcomers labels Aug 17, 2021
@schorfES schorfES self-assigned this Aug 17, 2021
@sahithyandev
Copy link

requestIdleCallback is not available on Safari. Isn't that a problem?

https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback#browser_compatibility

@schorfES
Copy link
Owner Author

Hi @sahithyandev, yes this is definitely a problem. I've thought about to feature detect the support and in cases, if not supported to lazy load and use the debounce function as a fallback.

Another possibility is to require a polyfill and document this in the README. But since this "is an experimental technology" it might be better to support it out of the box and research more in the first direction instead of requiring a polyfill.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants