Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using debounce function in underscore

I use underscore.js to run task.

_.debounce(task, 100)

How stop executing _.debounce?

like image 506
Oksana Avatar asked Apr 18 '26 02:04

Oksana


2 Answers

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

like image 174
Felix Kling Avatar answered Apr 20 '26 15:04

Felix Kling


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

like image 22
julesbou Avatar answered Apr 20 '26 16:04

julesbou



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!