Created
June 29, 2015 19:34
-
-
Save megawac/4ccd381fbec1950d1b92 to your computer and use it in GitHub Desktop.
log if debounce isn't called
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hackyDebounce(func, wait, options) { | |
var called = false; | |
var debounced = _.debounce(function() { | |
called = true; | |
func.apply(this, arguments); | |
}, wait, options); | |
return function() { | |
debounced.apply(this, arguments); | |
if (!called) { | |
console.log("It wasn't called"); | |
} | |
called = false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment