Using debounce function in underscore

ぃ、小莉子 提交于 2019-12-10 20:27:30

问题


I use underscore.js to run task.

_.debounce(task, 100)

How stop executing _.debounce?


回答1:


_.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.

Have a look at the documentation for more information.




回答2:


I assume you want to slow down an expensive task, i've written a post here to explain the _.debounce() method behaviour.

Cheers

PS....archived post



来源:https://stackoverflow.com/questions/7026000/using-debounce-function-in-underscore

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!