Skip to content Skip to sidebar Skip to footer

Using Debounce Function In Underscore

I use underscore.js to run task. _.debounce(task, 100) How stop executing _.debounce?

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

Solution 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

Post a Comment for "Using Debounce Function In Underscore"