Skip to content

Commit faa6c5d

Browse files
committed
feat(utils): add delay helper to utils
1 parent bdfff6c commit faa6c5d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/utils.js

+8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
;(function(window, undefined) {
2+
3+
4+
window.delay = function(func, wait) {
5+
var args = Array.prototype.slice.call(arguments, 2);
6+
return setTimeout(function(){ return func.apply(null, args); }, wait);
7+
};
8+
9+
210
/* Debounce and throttle functions taken from underscore.js */
311
window.debounce = function(func, wait, immediate) {
412
var timeout;

0 commit comments

Comments
 (0)