在 Angular 4 项目中,我有一个函数(我们称之为它reload()),它可以随时被其他函数(我们称之为A()and B())调用。我想消除从orreload()的最后一次调用传递的直到 X 时间(即毫秒)的执行。我正在查看and函数,但我不明白它们是否真的可以帮助我。A()B()Rx.Observable.debounceRx.Observable.debounceTime
一个例子:
time 0ms: A() gets executed and it calls reload()
time 200ms: B() calls executed and it calls reload()
Since X is set to 500ms, reload() should be called only once and after 500ms.