{"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.1","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"},"gitHead":"d2475592c3e052fc932134c238a1c340a72b421e","bugs":{"url":"https://github.com/fabiospampinato/dettle/issues"},"homepage":"https://github.com/fabiospampinato/dettle#readme","_id":"dettle@1.0.1","_nodeVersion":"18.12.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-/oD3At60ZfhgzpofJtyClNTrIACyMdRe+ih0YiHzAniN0IZnLdLpEzgR6RtGs3kowxUkTnvV/4t1FBxXMUdusQ==","shasum":"25e07a725722e389d3dea28027fb4a53cf18d8dd","tarball":"http://registry-npm.ywwl.com/dettle/download/dettle-1.0.1.tgz","fileCount":21,"unpackedSize":12752,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZGCOd4z8LU/guoO025jpAsS8nACX6+3BIJzzh2ym6igIgF1O8eliAeHbw68mPysinG/A335SVVAeGdIwNSAZsBns="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj1F1MACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpE7g//WonIvcoTS+4HD5YOXUNPqKnWDL1z9x6tOb0qMUtlAS0sfk69\r\ny4AHS3ujunuw6q9uivX9xpaWu2Ag4x4mIMIfld72jx9rAFPhD5kjnJqyPF1D\r\nyYqFNclG+N5HhVUHaScbti2QCqlVjjzLG7jd5F9vnEiHWZyaiHNrjetesF+r\r\nNzs7CztL2FgbgVrlzT9LpnL/wW9i1onJtWk/csjD4ZAd9RfSQyHbCZDlUj5w\r\nSAv/54ERkG1AEGzpbeqfvR4hKtwsLvpqbOof6ppW0VS6gkqv7dlWDP3wGBde\r\n0pw84/95GK+38AFfUB00Gl3ud4egng6M2rCS0LZYVYv9UAQXQ7koYMhWqGUY\r\nNCoRN1qXyG/oD66A8Lo7Lm62W2Qf+tN6LfNEOTLrVStNWTg+39J6ddGXyGlB\r\njQyPqsM8Flf0qgT0ZQy/7Pzuo9sA4cFp6J05EwZpf9eIDikwY3hMXkh4shv/\r\n9Oax7xUYW8/CBggsUmE0RLTTnhqFrF7Q/FZ96WLT0b99rGrbBL5YDyejiKQU\r\ntBVN2Z7vQDCXSvKRYKdNdzBe70SbZ8s7Wh2indW6oWAtQOtMrQF4gWO4J4+t\r\nFpRktjiYES2VoiNQHn1gxU2zigTNxB0HLs5YjBYGSMbIrk7PBTIaNinGyogn\r\noyaON3kkvV7VLj8UxlxwRNYT3B5SUEDEjHk=\r\n=0mAC\r\n-----END PGP SIGNATURE-----\r\n","size":4016,"noattachment":false,"key":"/dettle/-/dettle-1.0.1.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.1_1674861900066_0.5553728704158427"},"_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":1674861900225,"_cnpm_publish_time":1674861900225,"dist-tags":{"latest":"1.0.5"}}