What does RxJS.Observable debounce do?

后端 未结 3 492
说谎
说谎 2020-12-10 11:32

Can anybody explain in plain English what RxJS Observable debounce function does?

I imagine it emits an event once in a while depending on the parameters, but my cod

3条回答
  •  独厮守ぢ
    2020-12-10 12:26

    .debounce() produces the last received value if no values were received within the specified interval.

    It means that as soon as you click within a second - nothing will be produced.

    If you want to throttle values to be emitted no more frequent than every second you need to use .sample(1000) instead.

提交回复
热议问题