RxJs: Reducing number of API Calls to your server using debounceTime
Exploring debounceTime in RxJs debounceTime This article assumes you have a decent knowledge of Observables. If you are new to Observables I highly recommend checking out the link below by Ashish Singh . Recently, I was working on a small project where I had to hit third-party API to get search results whenever a user starts entering some text in the input box. Something like real-time searches by Google. While I was implementing this feature I found an interesting behavior in the above approach and also discovered a new cool operator, which I would like to share with you in this blog post. Let’s get started. Example ( Jsbin Link ) So, I created a small example where I have an input box and an Observable watching that input box and on every keyup event, it will emit an KeyBoardEvent from which we will extract the value entered by the user using map operator. Further, On Subscribing to this Observable, we will pass every value emitte...