In the project I'm working on, there is a search button that triggers an API call when clicked. I want to ensure that if the button is clicked again while the previous API call is still in progress, the previous call will be cancelled and only the most recent API call will stay active. How can I achieve this functionality using TypeScript? Currently, I am attempting to use ngDestroy() when clicking the button, but it seems that this approach is not effective.