Sign in
Log inSign up
Dany Paredes

7 likes

·

3.2K reads

2 comments

Paolo Crivello
Paolo Crivello
Apr 21, 2023

Hi Dany. Sure that debounceTime is useful to limit the amount of emissions, however in your sample code it will never prevent multiple emissions. The reason is that the argument of the function ( the query string ) is wrapped around an of() operator. Said operator will only emit once, then complete. So there is no way for the debounceTime operator to observe any other emission. Each time your code calls the search function a new observable is created.

1
·
·1 reply
Dany Paredes
Dany Paredes
Author
·Apr 22, 2023

I appreciate your feedback and I'm happy to inform you that I've updated the article.

I've now added a search form to the example to better illustrate how debounceTime can be used to limit the number of emissions in an event stream. I hope this clears up any confusion. Thank you for your contribution.😊

·