Difference between audit and debounce in rxjs?

2019-04-04 00:08发布

I am reading the offical documentaion of rxjs and then i realized they both are doing exactly same thing.

To me they both seems to exactly similar.

Please someone point out difference between them (if any)

1条回答
来,给爷笑一个
2楼-- · 2019-04-04 00:26

I'm going to describe the difference between them in terms of their Time versions as that's how I understand them best.

Both auditTime and debounceTime will initially start a timer when an event comes in. Both will wait the given amount of time before they emit an event. The difference is that debounceTime resets the timer whenever a new event comes in while auditTime does not. auditTime will emit the most recent event after the given number of milliseconds whether or not it is still receiving events. debounceTime will wait for a gap in the events. You said you read the documentation but just to double check I have found this document particularly helpful.

查看更多
登录 后发表回答