From faa6c5db0002feccf681e9f919ed583eef152773 Mon Sep 17 00:00:00 2001 From: vieron Date: Fri, 25 Oct 2013 17:45:34 +0200 Subject: [PATCH] feat(utils): add delay helper to utils --- src/utils.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/utils.js b/src/utils.js index 5f340b37b..2cd423cd8 100644 --- a/src/utils.js +++ b/src/utils.js @@ -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;