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

Promise should be optional. #62

Open
TimUnderhay opened this issue Nov 17, 2021 · 1 comment
Open

Promise should be optional. #62

TimUnderhay opened this issue Nov 17, 2021 · 1 comment

Comments

@TimUnderhay
Copy link

Apologies if I've misinterpreted the documentation, but in V3 it seems that debounce now always returns a promise, no matter what. This breaks debounce in contexts where a Promise-wrapped result isn't expected, such as option parameters in 3rd-party libraries which expect a callback function. There should ideally be both a callback-based and a promise-based version of the function. I hope you don't mind the suggestion. Thanks!

@chodorowicz
Copy link
Owner

No need for apologies! Thanks for the feedback! 🙂 I'm open to this change and have two version of the debounce function.
Could you provide a specific example where it fails when promise is returned? You could use https://codesandbox.io/ or https://stackblitz.com/ to create an example? It would be useful to recreate the issue and I would be able to verify that a fix really fixes the issue.
Thanks!

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

2 participants