Add option to debounce asynchronous searches
See original GitHub issueAlthough in general i’m agains incrementing the API surface of the component, I think this is a reasonable addition.
It’s possible to debounce searches by the user, but what would involve a double nested promise, while in the component side is trivial to implement.
Something on the line of debounceSearch=200
(time in milliseconds)
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
How to use debounce on async function? - Stack Overflow
Lodash's debounce function takes in a function , time to wait and returns a function. So do it like this:
Read more >debounce-async - npm
A debounced function that delays invoking asynchronous functions. Preliminaries. A debounced function groups sequential calls to a function ...
Read more >Debounced function not awaiting async function #4815 - GitHub
After step 1: Search results matching search field at step 1 are shown ... delayedLastFmQuery = _.debounce(async function (q) { var ...
Read more >Asynchronous Autocomplete Search with React, axios, and ...
Asynchronous Autocomplete Search with React, axios, and lodash debounce. Trying to showcase how to debounce API calls using _.debounce and axios in react....
Read more >Debounce in JavaScript — Improve Your Application's ...
Implementing a debounce from scratch is a common interview question. It tests your understanding of intermediate and advanced JavaScript concepts such as: async...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve just added an entry in the cookbook showing how to do this on the user’s end, which only takes a couple extra lines of code.
I hope that helps understand promises + debounce.
@cibernox Thank you 👍 🎩