{"_id":"debounce-fn@7.0.0","bugs":{"url":"https://github.com/sindresorhus/debounce-fn/issues"},"dist":{"shasum":"42f6e3c4fa2f1d057424c70b81ce31173bd07e1a","tarball":"http://registry-npm.ywwl.com/debounce-fn/download/debounce-fn-7.0.0.tgz","fileCount":5,"integrity":"sha512-+U1O+wNOj3OhMhL+1Rj76UFLgA+4QYhyOrzotfMEBZtMQJrAv4bLYqeOtv5CpEvKV/RO+jLddGW9RTLBSYXDQQ==","signatures":[{"sig":"MEUCICnBPDGDZX9eEk5NmSbPc7nNCZMORW8SPp9N5hdDBhqdAiEAgF3QbC0f3e9d5lgql3f4wVSqHxKD1Ut7XMPIzNU3AeI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIB5IDKhwOcY5ytQ5ebwAaJ16EtQoN5QsN2lTwHXt/GioAiBdaM7x2y/xhdLqldUjGl/3bjef/m6zo1d9eO76MAXazQ=="}],"unpackedSize":7674,"size":2860,"noattachment":false,"key":"/debounce-fn/-/debounce-fn-7.0.0.tgz"},"name":"debounce-fn","type":"module","types":"./index.d.ts","author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"engines":{"node":">=22"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"6cce35773725f039e004afbb8012c2f1f8881c9f","license":"MIT","scripts":{"test":"xo && node --test && nz"},"version":"7.0.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"homepage":"https://github.com/sindresorhus/debounce-fn#readme","keywords":["debounce","function","debouncer","fn","func","throttle","delay","invoked"],"repository":{"url":"git+https://github.com/sindresorhus/debounce-fn.git","type":"git"},"_npmVersion":"12.2.0","description":"Debounce a function","directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"sideEffects":false,"_nodeVersion":"26.11.1","dependencies":{"mimic-function":"^5.0.1"},"_hasShrinkwrap":false,"devDependencies":{"nz":"^0.1.0","xo":"^5.0.1","@typescript/native":"npm:typescript@^7.0.2"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/debounce-fn_7.0.0_1792069776493_0.5289795267984461"},"readme":"# debounce-fn\n\n> [Debounce](https://davidwalsh.name/javascript-debounce-function) a function\n\n## Install\n\n```sh\nnpm install debounce-fn\n```\n\n## Usage\n\n```js\nimport debounceFunction from 'debounce-fn';\n\nwindow.onresize = debounceFunction(() => {\n\t// Do something on window resize\n}, {wait: 100});\n```\n\n## API\n\n### debounceFunction(input, options?)\n\nReturns a debounced function that delays calling the `input` function until after `wait` milliseconds have elapsed since the last time the debounced function was called.\n\nIt comes with a `.cancel()` method to cancel any scheduled `input` function calls.\n\n#### input\n\nType: `Function`\n\nFunction to debounce.\n\n#### options\n\nType: `object`\n\n##### wait\n\nType: `number`\\\nDefault: `0`\n\nTime in milliseconds to wait until the `input` function is called.\n\n##### maxWait\n\nType: `number`\\\nDefault: `Infinity`\n\nThe maximum time the `input` function is allowed to be delayed before it is invoked.\n\nThis can be used to control the rate of calls handled in a constant stream. For example, a media player may send updates every few milliseconds, but you only want to handle them once a second.\n\n##### before\n\nType: `boolean`\\\nDefault: `false`\n\nTrigger the function on the leading edge of the `wait` interval.\n\nFor example, this can be useful for preventing accidental double-clicks on a \"submit\" button from firing a second time.\n\n##### after\n\nType: `boolean`\\\nDefault: `true`\n\nTrigger the function on the trailing edge of the `wait` interval.\n\n## Related\n\n- [debounce](https://github.com/sindresorhus/debounce) - Similar, but simpler. This package adds support for the `maxWait` and `before`/`after` options.\n- [p-debounce](https://github.com/sindresorhus/p-debounce) - Debounce promise-returning & async functions\n","publish_time":1792069776622,"_cnpm_publish_time":1792069776622,"dist-tags":{"latest":"7.0.0"}}