Ways to debounce Http requests in Angular
Debouncing is the delay of a function/method execution or an action for a period of the specified time. During this specified time, calls to the method/function or action are collected and executes each one when the specified has elapsed.
Suppose you have a blog website with a search bar where users can search for posts. When a user types in the name of a blog to search in the search bar, an HTTP request is sent to the web API to search for blog post names or mentions with the search tokens.
You will find out that the server will always be called on every single letter typed. For example, you want articles based on "Javascript" and "optimization", then you typed "Javascript optimization". For every single letter in "Javascript optimization", the server will be called plus space, i.e the server will be called 23 times just to search for blog posts with "Javascript optimization" keywords and *ngFor will trigger change detection run on the component 10 times.
The c