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

Type definition for createWithTimers makes it hard to use #54

Closed
novemberborn opened this issue Jan 29, 2021 · 0 comments
Closed

Type definition for createWithTimers makes it hard to use #54

novemberborn opened this issue Jan 29, 2021 · 0 comments

Comments

@novemberborn
Copy link
Contributor

setTimeout in Node.js now has stuff like __promisify__ attached to it. The type definition should be adjusted so that you can do stuff like this:

const unrefDelay = delay.createWithTimers({
  clearTimeout,
  setTimeout (...args) {
    return setTimeout(...args).unref()
  },
})

See this line:

setTimeout: typeof setTimeout;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant