feat(utils): add delay helper to utils

This commit is contained in:
vieron
2013-10-26 19:49:31 +02:00
parent bdfff6ce67
commit faa6c5db00
+8
View File
@@ -1,4 +1,12 @@
;(function(window, undefined) {
window.delay = function(func, wait) {
var args = Array.prototype.slice.call(arguments, 2);
return setTimeout(function(){ return func.apply(null, args); }, wait);
};
/* Debounce and throttle functions taken from underscore.js */
window.debounce = function(func, wait, immediate) {
var timeout;