requestidlecallback-polyfill icon indicating copy to clipboard operation
requestidlecallback-polyfill copied to clipboard

Add timeout parameter support

Open ophirbucai opened this issue 10 months ago • 0 comments

Hi,

I noticed that the README mentions support for passing a timeout option to requestIdleCallback. I was curious to see how it implemented and noticed that the option is currently ignored and that didTimeout is always false.

I understand that this library is meant to be a lightweight polyfill and intentionally omitted the functionality. That said, I’ve worked on a minimal enhancement that supports timeout fallback behavior while maintaining compatibility with older environments. I’ve also included a test suite that mimics native behavior without adding additional dependencies.

Would you be open to a PR for this? Or would you prefer to keep the current implementation as-is?

ophirbucai avatar Apr 19 '25 04:04 ophirbucai