DEV Community

Discussion on: Introducing the Async Debounce pattern

 
xowap profile image
Rémy 🤖

Indeed, as @leoyli explained, JS has no threads because it follows a completely async paradigm. Which is kinda good but it just took 20 years to get the actual tools to deal with it.

I understand better your vision and actually you're not the first one to tell me this so I might think about it and produce something to solve that need too. However that's outside the scope of what I intended here.

To be specific, I deal a lot with things like "filter forms" where the user chooses filters which instantly impact the displayed results. In that case, only the latest state of the filters matters because you're only displaying the results currently matching the filters. That's why discarding intermediate queries makes sense!