projects
/
yaffs-website
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
a7f0f624355bf0d236e51c08b650e07e0d11a57d
[yaffs-website]
/
node_modules
/
throttleit
/
example.js
1
2
var throttle = require('./');
3
4
function onprogress(n) {
5
console.log('progress %s%', n);
6
}
7
8
onprogress = throttle(onprogress, 500);
9
10
var n = 0;
11
setInterval(function(){
12
if (n >= 100) return;
13
onprogress(n++);
14
}, 50);