Before I start re-inventing one, I’d like to hear community’s opinions, suggestions or existing solutions to a common problem: you have a text input, upon typing into which it automatically starts some sort of a process, like showing search results or suggestions. In order to not do a dumb “request on every keystroke”, a better solution would be to:
- have a time inverval between inputs, so that if you type next letter it won’t start searching until there’s a pause
- if there’s a search happening already, wait for it to finish before starting a new one, and upon starting do the one that ahs most recent input (cancel all previous ones)
and potentially other things I forgot. I’ve implemented this for one component myself, now I need to reuse this logic, so I thought before I refactor it I could ask for community input.