X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=node_modules%2Fthrottleit%2Fexample.js;fp=node_modules%2Fthrottleit%2Fexample.js;h=a7f0f624355bf0d236e51c08b650e07e0d11a57d;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/node_modules/throttleit/example.js b/node_modules/throttleit/example.js new file mode 100644 index 000000000..a7f0f6243 --- /dev/null +++ b/node_modules/throttleit/example.js @@ -0,0 +1,14 @@ + +var throttle = require('./'); + +function onprogress(n) { + console.log('progress %s%', n); +} + +onprogress = throttle(onprogress, 500); + +var n = 0; +setInterval(function(){ + if (n >= 100) return; + onprogress(n++); +}, 50);