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

Always return a function #18

Open
Richienb opened this issue Aug 26, 2020 · 1 comment
Open

Always return a function #18

Richienb opened this issue Aug 26, 2020 · 1 comment
Assignees

Comments

@Richienb
Copy link
Contributor

If no strategy can be found, null shouldn't be returned as it can lead to bugs. Instead, next-tick should just call the callback.

@medikoo
Copy link
Owner

medikoo commented Aug 26, 2020

@Richienb thanks for proposal. Still I think that returning a function will give a false idea that tasks will be propagated to next event loop and that is likely to introduce bugs in systems that depend on such behavior

If in given setup it's ok to fallback to immediate execution I believe that such decision should be made explicitly, and it can be achieved easily as:

const eventuallyNextTick = require('next-tick') || cb => cb();

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

No branches or pull requests

2 participants