{"name":"dettle","repository":{"type":"git","url":"git+https://github.com/fabiospampinato/dettle.git"},"description":"A tiny fully-featured debounce and throttle implementation.","version":"1.0.0","type":"module","main":"dist/index.js","exports":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"clean":"tsex clean","compile":"tsex compile","compile:watch":"tsex compile --watch","test":"tsex test","test:watch":"tsex test --watch","prepublishOnly":"npm run clean && npm run compile && npm run test"},"keywords":["tiny","debounce","throttle"],"devDependencies":{"fava":"^0.0.7","tsex":"^1.1.4","typescript":"^4.9.4"},"bugs":{"url":"https://github.com/fabiospampinato/dettle/issues"},"homepage":"https://github.com/fabiospampinato/dettle#readme","_id":"dettle@1.0.0","_nodeVersion":"18.12.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-OcLLmFjrmIGU7Tjz5ZwFw74FtWiXi1WMOQzqcLhK1/rBxr0VveNQ4RjZon+3o2SVSPJEv0W2POLFCEjdbcbm0g==","shasum":"ae1019d0dce71623f36494d50b6490028f2186f1","tarball":"http://registry-npm.ywwl.com/dettle/download/dettle-1.0.0.tgz","fileCount":21,"unpackedSize":12268,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAcBHFmvGqZzsoeXI6dr71Bpl3WW+/uPkb3ttFrZNSFRAiBeHHCvheDkvTSq27gpOP7Eld3TZWMjCAOZh8ME9Hareg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj1Cs1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrWNw//QvfSRHvuRAtCXoEy2R3158szA7DMsa4Gx81kKBvJWEescoCz\r\nvZs/WYRMzRND3wS3X1wLVu6SBhRPLrSjE5loYFpiAV8IlGpSGXY94YS3THN7\r\nzKBlDq8MPpWFIZAdXS5dIkSor1FvF3N392NvR7pTUW8hORTXKCuPp6DK7djE\r\ny/vygJ2z8SCjR3kPhSxlcGUHqSOyQwDqZAqYrAkQpIZEMevE5M2nFSt0/kLp\r\n38bdsg0X9a4lhF45iV0wC0Lnl8rPKJHjnPoKV/S4lFbJ2gx0WZnYbSTHD5CL\r\n7W0i8R0QQDZbywnT1vdGk3TyUoHLhb/TebOtcokU+Bc5XEQ9+Of1quldSWmG\r\nfgUeUN5R8Bevr57MJq+L4AAk0LCzi+pSRjmwUi/r7LWoS4YjeLGBfJ6Ye8Ba\r\nT2AId6Je9foFg74khjr6eigqZLN0GimH7mdLmvtJpjGgW3W/EMe6jTIU12z0\r\nr9zi73uPcJhlRyGa/5nd1SQZuK1gkM8Zs+8ZHVC9sY6492htO4wJXR9vew7D\r\nCDQQj5ykmetId9v7vn6wQIIo5DC9mG4ZfhwlzMxhV28xm9xNJVg0QyQoJ6cV\r\n3h/KT8vONjFCdJjufuDE88PEVbhieyvhZ0WHXrsFS6eL6DjuqU4cP5qXqJO2\r\nWoxB3SE+qdINQuxNzaJMdweJyDa2/nh4C/0=\r\n=Xdoy\r\n-----END PGP SIGNATURE-----\r\n","size":3960,"noattachment":false,"key":"/dettle/-/dettle-1.0.0.tgz"},"_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"directories":{},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dettle_1.0.0_1674849077366_0.36311149847736934"},"_hasShrinkwrap":false,"readme":"# Dettle\n\nA tiny fully-featured debounce and throttle implementation.\n\n## Install\n\n```sh\nnpm install --save dettle\n```\n\n## Usage\n\n```ts\nimport {debounce, throttle} from 'dettle';\n\nconst fn = () => console.log ( 'Fired!' );\n\n// Debouncing\n\nconst debounced = debounce ( fn, 1000, {\n  leading: false,\n  maxWait: 3000\n});\n\ndebounced (); // Schedule function for execution\ndebounced (); // Re-schedule function for execution\n\ndebounced.flush (); // Execute the function immediately, if there's a scheduled execution\ndebounced.cancel (); // Cancel the scheduled execution\n\n// Throttling\n// The API for throttling is basically the same, except that:\n// - `maxWait` is set implicitly for you to be equal to the wait time\n// - `leading` is `true` by default rather than `false`\n\nconst throttled = throttle ( fn, 1000 );\n\nthrottled (); // Call the function immediately\nthrottled (); // Schedule function for execution\n\nthrottled.flush (); // Execute the function immediately, if there's a scheduled execution\nthrottled.cancel (); // Cancel the scheduled execution\n```\n\n## License\n\nMIT © Fabio Spampinato\n","publish_time":1674849077498,"_cnpm_publish_time":1674849077498,"dist-tags":{"latest":"1.0.5"}}