rxjs中审核和反跳之间的区别? [英] Difference between audit and debounce in rxjs?

查看:95
本文介绍了rxjs中审核和反跳之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读rxjs的官方文档,然后我意识到它们都在做完全相同的事情.

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)

推荐答案

我将根据它们的Time版本来描述它们之间的区别,因为这是我对它们的最佳理解.

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

auditTimedebounceTime都将在事件进入时首先启动计时器.两者都将等待给定的时间,然后才发出事件.不同之处在于,只要有新事件出现,debounceTime就会重置计时器,而auditTime不会出现. auditTime将在给定的毫秒数后发出最近的事件,无论它是否仍在接收事件. debounceTime将等待事件中的间隔.您说您已经阅读了文档,但只是仔细检查一下,我发现文档特别有用

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.

这篇关于rxjs中审核和反跳之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆