Skip to content

Add timeout parameter support #5

@ophirbucai

Description

@ophirbucai

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions