From ae34dcfd3823a609ba7182f2d6eda593be876f7d Mon Sep 17 00:00:00 2001 From: Arman Shah Date: Mon, 19 Feb 2018 23:50:04 -0800 Subject: add base files --- node_modules/throttleit/example.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 node_modules/throttleit/example.js (limited to 'node_modules/throttleit/example.js') diff --git a/node_modules/throttleit/example.js b/node_modules/throttleit/example.js new file mode 100644 index 0000000..a7f0f62 --- /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); -- cgit v1.2.3