在下划线中使用去抖功能 [英] Using debounce function in underscore
本文介绍了在下划线中使用去抖功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用underscore.js来运行任务。
I use underscore.js to run task.
_.debounce(task, 100)
如何停止执行 _.debounce
?
推荐答案
_.debounce
不会执行任何操作,因此您无法阻止它。 返回一个负责去抖动的新功能。
_.debounce
does not execute anything, so you cannot stop it. It returns a new function which takes care of the debouncing.
如果您不想再使用它,只需使用原始功能即可。
If you don't want to use it anymore, just use the original function.
查看文档了解更多信息。
这篇关于在下划线中使用去抖功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文