{"_id":"@afoot/whoa","_rev":"2-9e853447651a6b4405d71ebe19cf640a","name":"@afoot/whoa","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.1":{"name":"@afoot/whoa","version":"0.1.1","description":"A throttle/debounce library. Use it to time events and reduce XHR server loads.","author":{"name":"Matthew Smith","email":"code@niftinessafoot.com","url":"https://www.niftinessafoot.com"},"keywords":["throttle","debounce","module","typescript"],"scripts":{"prebuild":"npm run clean","build":"rollup -c rollup.config.js -i src/index.ts","build:prod":"npm run build && npm run types","prepack":"npm run build:prod && npm run prep:umd","clean":"rm -rf dist/*","types":"tsc","test":"jest","test:coverage":"jest --coverage","docs":"typedoc","prep:umd":"node ./lib/init-umd-config.js"},"entry":"index.ts","types":"dist/types/index.d.ts","main":"dist/umd/index.js","module":"dist/esm/index.js","exports":{".":{"types":"./dist/types/index.d.ts","require":"./dist/umd/index.js","import":"./dist/esm/index.js","default":"./dist/umd/index.js"},"./standalone":{"types":"./dist/types/index.d.ts","require":"./dist/umd/standalone.js","import":"./dist/esm/standalone.js","default":"./dist/umd/legacy.js"},"./legacy":"./dist/umd/legacy.js"},"license":"MIT","browserslist":["defaults"],"homepage":"https://www.niftinessafoot.com","bugs":{"url":"https://github.com/niftinessafoot/lineage/issues"},"repository":{"type":"git","url":"git+https://github.com/niftinessafoot/lineage.git"},"type":"module","devDependencies":{"@babel/cli":"^7.19.3","@babel/core":"^7.20.5","@babel/preset-env":"^7.20.2","@babel/preset-react":"^7.18.6","@babel/preset-typescript":"^7.18.6","@rollup/plugin-babel":"^6.0.3","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^13.4.0","@types/jest":"^29.2.4","@typescript-eslint/eslint-plugin":"^5.46.0","@typescript-eslint/parser":"^5.46.0","eslint":"^8.29.0","eslint-config-prettier":"^8.5.0","eslint-plugin-react":"^7.31.11","eslint-plugin-tsdoc":"^0.2.17","jest":"^29.3.1","jest-environment-jsdom":"^29.3.1","prettier":"^2.8.1","rollup":"^2.79.1","rollup-plugin-terser":"^7.0.2","typedoc":"^0.23.22","typedoc-plugin-markdown":"^3.14.0","typescript":"^4.9.4"},"gitHead":"bb0c525afe7cbb15f5f82fb0ad6b651683d7f86f","_id":"@afoot/whoa@0.1.1","_nodeVersion":"18.14.1","_npmVersion":"9.3.1","dist":{"integrity":"sha512-Udk7kBymMoE3VT5qoe1GEoKIfP7kwHCPCPNW3+RDfOOtOULeJL9cD3pBiytVNWpINE7eyEhn0wFTm3Qd1RP1tQ==","shasum":"1c14b17c5f308c1929f592f09473bbfdc5c4e2de","tarball":"https://registry.npmjs.org/@afoot/whoa/-/whoa-0.1.1.tgz","fileCount":16,"unpackedSize":23500,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEitPdRocDzOzm+1S5PmQd9VOJkZmJ42zahq71T0zzfWAiANXMke//nA18kpEi2CYpdx/35TFd7jlHKWyY3m0lQb2A=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/WqBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpgKw/+LoE/5VnVDeRPcwfUM3G9+SUemxLKZPAXaqw79BWwKV5VItkP\r\nuLYBzbQTgcw7J3Rp/UdIJpnKh9U2S0cmK3UJP1LJ5+WZJzVv7qextIrWa5Zx\r\nZ8NcpzBHO/CDG5UcIzvYehDtwX94qR1zVmOJYi/FnbgY0EnykPEvVOAep3go\r\nexRFLSAM0q8N0TamaMfqtsAwKLtstnlGDTbWEJ2WyCjWBtOdgyMN1dLdg9lf\r\nlCcKYNDwmC/AGROLVszps/9f2IBnk/lkO42xhOs15YLE8k+OHSb9UL01TPmy\r\ncEOT34rJB1idoBB8DAZgrciC/2ruZgk0qZJ8WI9BgCy3X+fNz2l3epX3EplK\r\n/9gF4ogtPWrerUpFLfPkSHvsD8RDhhaYwIfvMeOxJoot08XKSdb1MWg1jAds\r\nzMU82Yh88zGN7MUp64XoMgptT8OY50UWC5I+lC5UzklCkDohG1aVaTfopnKf\r\n9IExJZ+vrzcDGhmDYLz6Ram7nEq/FZTAWy6Ob/5HWIhV4QXvG3bEWWEUTqzP\r\n0/yHnoovOXO8a2r8FytflS62ej7JB+E6YbO36Nx85GihaOEqeDatJsYwpuis\r\nozLhr43PPzvcXMS/SkvZcjBsfrmzcmmwuKseCIx6NK02u/llId4cmOQbVb/J\r\n5GyhaRMIImF3U3hpZFV9z9oxhOFe6zsXq3Q=\r\n=pplN\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"niftinessafoot","email":"niftinessafoot@gmail.com"},"directories":{},"maintainers":[{"name":"niftinessafoot","email":"niftinessafoot@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/whoa_0.1.1_1677552257739_0.2530168852889634"},"_hasShrinkwrap":false},"0.1.2":{"name":"@afoot/whoa","version":"0.1.2","description":"A throttle/debounce library. Use it to time events and reduce XHR server loads.","author":{"name":"Matthew Smith","email":"code@niftinessafoot.com","url":"https://www.niftinessafoot.com"},"keywords":["throttle","debounce","module","typescript"],"scripts":{"prebuild":"npm run clean","build":"rollup -c rollup.config.js -i src/index.ts","build:prod":"npm run build && npm run types","prepack":"npm run build:prod && npm run prep:umd","clean":"rm -rf dist/*","types":"tsc","test":"jest","test:coverage":"jest --coverage","docs":"typedoc","prep:umd":"node ./lib/init-umd-config.js"},"entry":"index.ts","types":"dist/types/index.d.ts","main":"dist/umd/index.js","module":"dist/esm/index.js","exports":{".":{"types":"./dist/types/index.d.ts","require":"./dist/umd/index.js","import":"./dist/esm/index.js","default":"./dist/umd/index.js"},"./standalone":{"types":"./dist/types/index.d.ts","require":"./dist/umd/standalone.js","import":"./dist/esm/standalone.js","default":"./dist/umd/legacy.js"},"./legacy":"./dist/umd/legacy.js"},"license":"MIT","browserslist":["defaults"],"homepage":"https://www.niftinessafoot.com","bugs":{"url":"https://github.com/niftinessafoot/lineage/issues"},"repository":{"type":"git","url":"git+https://github.com/niftinessafoot/lineage.git"},"type":"module","devDependencies":{"@babel/cli":"^7.19.3","@babel/core":"^7.20.5","@babel/preset-env":"^7.20.2","@babel/preset-react":"^7.18.6","@babel/preset-typescript":"^7.18.6","@rollup/plugin-babel":"^6.0.3","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^13.4.0","@types/jest":"^29.2.4","@typescript-eslint/eslint-plugin":"^5.46.0","@typescript-eslint/parser":"^5.46.0","eslint":"^8.29.0","eslint-config-prettier":"^8.5.0","eslint-plugin-react":"^7.31.11","eslint-plugin-tsdoc":"^0.2.17","jest":"^29.3.1","jest-environment-jsdom":"^29.3.1","prettier":"^2.8.1","rollup":"^2.79.1","rollup-plugin-terser":"^7.0.2","typedoc":"^0.23.22","typedoc-plugin-markdown":"^3.14.0","typescript":"^4.9.4"},"gitHead":"8e4e257eab5dff49da2f4d6f43bf8287e290eb6b","_id":"@afoot/whoa@0.1.2","_nodeVersion":"18.14.1","_npmVersion":"9.3.1","dist":{"integrity":"sha512-KuJ5Ut0Wktc8gDqVtlDAqd8W1Or46w889crGIAwx+8tCy1xBUWEGfDO85qMO+lxhQAVjZ+bBsajLnqvUJiplwg==","shasum":"dc79267a8d6f47bc59b83b48c5f83d7ef626a29d","tarball":"https://registry.npmjs.org/@afoot/whoa/-/whoa-0.1.2.tgz","fileCount":16,"unpackedSize":23633,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDr/qvudU0qy+N5bPCBVB5GGlg7LTpGiKuKd8aDMH9W4AIhAImjV2+0YV3s0iLm4gFRuv42Yd4Dc07zrM5agoJTzwfn"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/W/vACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqx+RAAjlnigs+DxcZLGL2W5geMUsFQ9FpUOCYGqRDwcX0RlGoyzR8K\r\nN7UCrN1vmxm86fVGjf49ms53hZTKHNhHdXBiJr5N8o+vlI87cNgRa6JFXDUc\r\nIjRTNeEteoXwec8Wm1oC7lhVxMO/bQNN/IFZEFtTxgTrweQVB2QQs4ZaUftc\r\n3kpJtM6loHT4p7nGPLA0AiBRAnArRbj5kEj144JQjWHuOn5KCVDqjCpvsWEV\r\nQWjwGy3VyRrR0XOEWQQrUZ8Q08xfv3vDJfjegFsh61eqzzJHfPyvll4b1kuu\r\nlCTWoNjhM/0O5r0TOwuGZCkKaZhn4rmlxzhfWvCJ3VL4gXjzE919vrx7oRFn\r\n49Zyj5G1ptsXpo66tziiIB4qJhvrbB7h6eqaa9vPtN4zDKjNJIk2Af4XEvP0\r\n1lk8SGxkun6E/X5gW6a5EhS1WS3rMxMTrRKyqkqfzkjttvIWhuyZnrLnmh/3\r\nzR9kTiPNHe2DfbZDmweUDM9rI7qThdMECz6gqqFvWb6HjwCd0QP3PFtNeIub\r\nxYhorHbUCuj4bFYXkB3tskTjYWf4OKlzu4yXaTRRR5/xxW20M/GujA2nRtsK\r\nEGr3npS/kOjKSFHzcuS1ZDnJjXelQ07HI4HlcIggmEbaiXfXfAEBJug+GxRy\r\nOzOWogqgRYKUhzM9+G/DWwR0k4REMx6nPEQ=\r\n=4fXz\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"niftinessafoot","email":"niftinessafoot@gmail.com"},"directories":{},"maintainers":[{"name":"niftinessafoot","email":"niftinessafoot@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/whoa_0.1.2_1677553647216_0.4777123484431991"},"_hasShrinkwrap":false},"0.1.3":{"name":"@afoot/whoa","version":"0.1.3","description":"A throttle/debounce library. Use it to time events and reduce XHR server loads.","author":{"name":"Matthew Smith","email":"code@niftinessafoot.com","url":"https://www.niftinessafoot.com"},"keywords":["throttle","debounce","module","typescript"],"scripts":{"prebuild":"npm run clean","build":"rollup -c rollup.config.js -i src/index.ts","build:prod":"npm run build && npm run types","prepack":"npm run build:prod && npm run prep:umd","clean":"rm -rf dist/*","types":"tsc","test":"jest","test:coverage":"jest --coverage","docs":"typedoc","prep:umd":"node ./lib/init-umd-config.js"},"entry":"index.ts","types":"dist/types/index.d.ts","main":"dist/umd/index.js","module":"dist/esm/index.js","exports":{".":{"types":"./dist/types/index.d.ts","require":"./dist/umd/index.js","import":"./dist/esm/index.js","default":"./dist/umd/index.js"},"./standalone":{"types":"./dist/types/index.d.ts","require":"./dist/umd/standalone.js","import":"./dist/esm/standalone.js","default":"./dist/umd/legacy.js"},"./legacy":"./dist/umd/legacy.js"},"license":"MIT","browserslist":["defaults"],"homepage":"https://github.com/niftinessafoot/whoa","bugs":{"url":"https://github.com/niftinessafoot/whoa/issues"},"repository":{"type":"git","url":"git+https://github.com/niftinessafoot/whoa.git"},"type":"module","devDependencies":{"@babel/cli":"^7.19.3","@babel/core":"^7.20.5","@babel/preset-env":"^7.20.2","@babel/preset-react":"^7.18.6","@babel/preset-typescript":"^7.18.6","@rollup/plugin-babel":"^6.0.3","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^13.4.0","@types/jest":"^29.2.4","@typescript-eslint/eslint-plugin":"^5.46.0","@typescript-eslint/parser":"^5.46.0","eslint":"^8.29.0","eslint-config-prettier":"^8.5.0","eslint-plugin-react":"^7.31.11","eslint-plugin-tsdoc":"^0.2.17","jest":"^29.3.1","jest-environment-jsdom":"^29.3.1","prettier":"^2.8.1","rollup":"^2.79.1","rollup-plugin-terser":"^7.0.2","typedoc":"^0.23.22","typedoc-plugin-markdown":"^3.14.0","typescript":"^4.9.4"},"gitHead":"9dbbd22bb8634a6723b2097f507bc898065c20bb","_id":"@afoot/whoa@0.1.3","_nodeVersion":"18.16.1","_npmVersion":"9.5.1","dist":{"integrity":"sha512-T6QkED5veYCdMBHCzI4OOMYH6e3pOfMYRBEQiWqnXZg5OvR4l+uVKoKyhspUyMKeCUdaO9LXlT+Mfb0Ur1f2pg==","shasum":"e9a1cebf98fd97abe9b0d4a53b6c7475045c3227","tarball":"https://registry.npmjs.org/@afoot/whoa/-/whoa-0.1.3.tgz","fileCount":16,"unpackedSize":23635,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHgygedOboWDUWvydh8HO6Jv2D+jCoYlh/pwNHz0HXv4AiEA/8XC7X1gm7NULqfYtpRohW3XrufnBKBst3+VaSseUrw="}]},"_npmUser":{"name":"niftinessafoot","email":"niftinessafoot@gmail.com"},"directories":{},"maintainers":[{"name":"niftinessafoot","email":"niftinessafoot@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/whoa_0.1.3_1689199898696_0.2532301738207452"},"_hasShrinkwrap":false}},"time":{"created":"2023-02-28T02:44:17.678Z","0.1.1":"2023-02-28T02:44:17.902Z","modified":"2023-07-12T22:11:39.146Z","0.1.2":"2023-02-28T03:07:27.395Z","0.1.3":"2023-07-12T22:11:38.905Z"},"maintainers":[{"name":"niftinessafoot","email":"niftinessafoot@gmail.com"}],"description":"A throttle/debounce library. Use it to time events and reduce XHR server loads.","homepage":"https://github.com/niftinessafoot/whoa","keywords":["throttle","debounce","module","typescript"],"repository":{"type":"git","url":"git+https://github.com/niftinessafoot/whoa.git"},"author":{"name":"Matthew Smith","email":"code@niftinessafoot.com","url":"https://www.niftinessafoot.com"},"bugs":{"url":"https://github.com/niftinessafoot/whoa/issues"},"license":"MIT","readme":"# Whoa\nA throttle/debounce library. Use it to time events and reduce XHR server loads.\n\n## Wait, _another_ one?\nYeah. These things are like birdhouses. Why do we build a birdhouse when there are billions out there? Because we can. There are many debounce and trottle libraries. This one’s mine.\n\n## Why would I use this one?\nYou shouldn’t. Go use lodash or something. Or make your own.\n\nBut mine’s here if you _really_ wanna use it. It’s got full unit test passing and typings and everything.\n## usage\n\n### throttle\n```js\nimport {throttle} from '@afoot/whoa;\n\nconst callback = (evt)=>{console.log(evt);};\nconst throttledCallback = throttle(callback, 250);\n\ndocument.body.addEventListener('mousemove',throttledCallback); //Only fires once every 250ms;\n```\n\n### debounce\n```js\nimport {debounce} from '@afoot/whoa;\n\nconst callback = (evt)=>{console.log(evt);};\nconst debouncedCallback = debounce(callback, 250);\n\ndocument.body.addEventListener('keydown',debouncedCallback); //Only fires _after_ keydown stops firing for 250ms\n```\n\n### when to use `throttle` and when to use `debounce`\n**Throttle** is when you need something to reliably fire over and over, but less often. Like scrolling and mouse movement. You don’t need 250 calls per second—you need maybe 60.\n\n**Debounce** waits for you to finish something. Like typing. If you’re saving a text field to the database, you likely don’t want to write on every character input. Instead, debounce waits the defined delay before taking action—like if you stopped typing for a moment. Or you finished scrolling.\n\n## license\n\n[MIT](./LICENSE) © [Matthew Smith](http://www.niftinessafoot.com)\n\n## made with ❤️ and ☕️ by\n\n![Niftiness Afoot!](https://gist.githubusercontent.com/niftinessafoot/2dba588395cb557293d5f09aebcd2ab0/raw/770293c76bead4f0986ff959f3ea8880017d92c0/bot.svg?sanitize=true) [Matthew Smith](https://github.com/niftinessafoot)\n","readmeFilename":"README.md"}