{"_id":"dettle","_rev":"3757978","name":"dettle","description":"A tiny fully-featured debounce and throttle implementation.","dist-tags":{"latest":"1.0.5"},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"time":{"modified":"2025-03-18T07:12:44.000Z","created":"2023-01-27T19:51:17.498Z","1.0.5":"2025-01-11T22:00:33.424Z","1.0.4":"2024-06-30T16:14:07.287Z","1.0.3":"2024-06-30T15:47:06.072Z","1.0.2":"2024-04-04T22:34:36.985Z","1.0.1":"2023-01-27T23:25:00.225Z","1.0.0":"2023-01-27T19:51:17.498Z"},"users":{},"repository":{"type":"git","url":"git+https://github.com/fabiospampinato/dettle.git"},"versions":{"1.0.5":{"name":"dettle","repository":{"type":"git","url":"git+https://github.com/fabiospampinato/dettle.git"},"description":"A tiny fully-featured debounce and throttle implementation.","license":"MIT","version":"1.0.5","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":"tsex prepare"},"keywords":["tiny","debounce","throttle"],"devDependencies":{"fava":"^0.3.4","tsex":"^4.0.2","typescript":"^5.7.3"},"_id":"dettle@1.0.5","gitHead":"ce9d1f08b7f8f9d7ad9a556b11c9351eca7689d9","bugs":{"url":"https://github.com/fabiospampinato/dettle/issues"},"homepage":"https://github.com/fabiospampinato/dettle#readme","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"shasum":"ed3a526012b2faf0ec0f0f907929019a78091445","size":2935,"noattachment":false,"key":"/dettle/-/dettle-1.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/dettle/download/dettle-1.0.5.tgz"},"_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"directories":{},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dettle_1.0.5_1736632833226_0.7293312683694275"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-01-11T22:00:33.424Z","publish_time":1736632833424,"_source_registry_name":"default","_cnpm_publish_time":1736632833424},"1.0.4":{"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.4","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":"tsex prepare"},"keywords":["tiny","debounce","throttle"],"devDependencies":{"fava":"^0.3.4","tsex":"^4.0.2","typescript":"^5.5.2"},"_id":"dettle@1.0.4","gitHead":"0bcc649488cf04330b1effa973b4f3e2a86271fa","bugs":{"url":"https://github.com/fabiospampinato/dettle/issues"},"homepage":"https://github.com/fabiospampinato/dettle#readme","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"shasum":"218679cb569a5e507e61c7ad53989fc2a0bc8bb5","size":4050,"noattachment":false,"key":"/dettle/-/dettle-1.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/dettle/download/dettle-1.0.4.tgz"},"_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dettle_1.0.4_1719764047150_0.1232983450287044"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-06-30T16:14:07.287Z","publish_time":1719764047287,"_source_registry_name":"default","maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_cnpm_publish_time":1719764047287},"1.0.3":{"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.3","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":"tsex prepare"},"keywords":["tiny","debounce","throttle"],"devDependencies":{"fava":"^0.3.2","tsex":"^4.0.2","typescript":"^5.5.2"},"_id":"dettle@1.0.3","gitHead":"740fa485b7ca6059f2ab0f11712f40dbcd68645f","bugs":{"url":"https://github.com/fabiospampinato/dettle/issues"},"homepage":"https://github.com/fabiospampinato/dettle#readme","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"shasum":"0276262eaa8bc06a6d6ce98dc209d344ba708029","size":4072,"noattachment":false,"key":"/dettle/-/dettle-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/dettle/download/dettle-1.0.3.tgz"},"_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dettle_1.0.3_1719762425915_0.42727674475084076"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-06-30T15:47:06.072Z","publish_time":1719762426072,"_source_registry_name":"default","maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_cnpm_publish_time":1719762426072},"1.0.2":{"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.2","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":"tsex prepare"},"keywords":["tiny","debounce","throttle"],"devDependencies":{"fava":"^0.2.0","tsex":"^3.0.0","typescript":"^5.1.6"},"_id":"dettle@1.0.2","gitHead":"26a75367c385213be33d9a6163f3afc6359e2d94","bugs":{"url":"https://github.com/fabiospampinato/dettle/issues"},"homepage":"https://github.com/fabiospampinato/dettle#readme","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"shasum":"d0f772ca718709e1cc60335aa54362313527235c","size":3947,"noattachment":false,"key":"/dettle/-/dettle-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/dettle/download/dettle-1.0.2.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.2_1712270076751_0.8126230395162888"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-04-04T22:34:36.985Z","publish_time":1712270076985,"_source_registry_name":"default","_cnpm_publish_time":1712270076985},"1.0.1":{"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":{"shasum":"25e07a725722e389d3dea28027fb4a53cf18d8dd","size":4016,"noattachment":false,"key":"/dettle/-/dettle-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/dettle/download/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,"_cnpmcore_publish_time":"2023-01-27T23:25:00.225Z","publish_time":1674861900225,"_cnpm_publish_time":1674861900225},"1.0.0":{"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":{"shasum":"ae1019d0dce71623f36494d50b6490028f2186f1","size":3960,"noattachment":false,"key":"/dettle/-/dettle-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/dettle/download/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,"_cnpmcore_publish_time":"2023-01-27T19:51:17.498Z","publish_time":1674849077498,"_cnpm_publish_time":1674849077498}},"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// The following options are supported:\n// `leading`: whether the function should be called when the timeout is created, defaults to `false`\n// `trailing`: whether the function should be called when the timeout expires, defaults to `true`\n// `maxWait`: the maximum amount of time that can pass before the function is called, defaults to `Infinity`\n\nconst debounced = debounce ( fn, 1000, {\n  leading: false,\n  trailing: true,\n  maxWait: Infinity\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// - `leading`: is `true` by default rather than `false`\n// - `maxWait`: is set implicitly for you to be equal to the wait time\n\nconst throttled = throttle ( fn, 1000, {\n  leading: true,\n  trailing: true\n});\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","_attachments":{},"homepage":"https://github.com/fabiospampinato/dettle#readme","bugs":{"url":"https://github.com/fabiospampinato/dettle/issues"},"license":"MIT"}