Closed superandrew213 closed 5 years ago
I got it to work using debounce-promise
. Lodash.debounce was not working properly.
Yeah! The data provider is able to eat Promise, so it should be fine to use whatever solution you might like.
@superandrew213 can you please share a code snippet with the debounce-promise
. In my case what seems to happen is it stacks all the calls to dataProvider
and calls them all after the debounce period.
The problem was on my end, I was playing with react-textarea-autocomplete
inside of react-styleguidst code snippet which triggers re-render on every update.
Performing server lookups on every letter change might not be necessary. Receiving the delayed results one after another doesn't look that nice either.
What do you think about adding an option to debounce dataProvider?
Another option would be to provide a
results
prop and aonTokenChange
prop? This way we can have more control.Or maybe I am missing something and you can already do this.