function defer(fn) {
    var timer = null;

    return function() {
        clearTimeout(timer);

        timer = setTimeout(fn, 400);
    }
}

@@ -136,8 +136,65 @@
     %7D%0A%7D%0A
+%0A// TODO: add some variations; like on utilizes RAF etc.%0A

Update defer.js