问题
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