Skip to content

Instantly share code, notes, and snippets.

View rendro's full-sized avatar
🤘
🤪

Robert rendro

🤘
🤪
View GitHub Profile
@rendro
rendro / defer.js
Created April 30, 2013 08:21
defer wrapper to call a function deferred with a specific context
var defer = function (cb, t, ctx) {
t = t || 0;
ctx = ctx || this;
return function () {
var args = Array.prototype.slice.call(arguments);
setTimeout(function() {
cb.apply(ctx, args);
}, t);
};
};