Created
July 30, 2012 18:29
-
-
Save cowboy/3208977 to your computer and use it in GitHub Desktop.
for john k paul
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
var debounced = $.debounce(1000, orig); | |
var wrapper = function() { | |
// you have my permission to write whatever logic is useful to you here | |
if (arguments[0] === 'foo') { | |
orig.apply(null, arguments); | |
} else { | |
debounced.apply(null, arguments); | |
} | |
}; | |
wrapper('foo', 'bar', 'baz'); // calls orig function | |
wrapper('omg', 'ponies'); // calls debounced function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment