This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var throttle = (function () { | |
return function (fn, delay) { | |
delay || (delay = 100); | |
var last = +new Date; | |
return function () { | |
var now = +new Date; | |
if (now - last > delay) { | |
fn.apply(this, arguments); | |
last = now; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var module = (function() { | |
var _private = { | |
i:5, | |
get : function() { | |
console.log( "current value:" + this.i); | |
}, | |
set : function( val ) { | |
this.i = val; | |
}, |
NewerOlder