{"name":"debounce-fn","version":"3.0.0","description":"Debounce a function","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/debounce-fn.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["debounce","function","debouncer","fn","func","throttle","delay","invoked"],"dependencies":{"mimic-fn":"^2.1.0"},"devDependencies":{"ava":"^1.4.1","delay":"^4.2.0","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"314c5ef7819730b5f5b39648b9aa1c398d479747","bugs":{"url":"https://github.com/sindresorhus/debounce-fn/issues"},"homepage":"https://github.com/sindresorhus/debounce-fn#readme","_id":"debounce-fn@3.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-XIFjOpDubtoD2remxvH1EumsE4A+8aAgrLFGeQ4nRUmDSa9dDYFLCbxhd2DpnycKbSI3V4yf8eHTxorlOfm4cA==","shasum":"e0acbc6c9453523cd81289ca7ce386610e65a7aa","tarball":"http://registry-npm.ywwl.com/debounce-fn/download/debounce-fn-3.0.0.tgz","fileCount":5,"unpackedSize":5121,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcrWH7CRA9TVsSAnZWagAAT/0P/026xQ6I8RiW7wNT6ilt\nCQ0Mw04hOLmxzHeAePR1nDPcUM70RfGPZ1wdT5jGn4Y71SpZAfR4hnPcDZs8\nGhElZ23Gik0Wje3d1cba/fyqbmd4FWCIOKJWrHhkgbSPgIThYNfZaHTN6rVh\nz5Q9l3KGmXysCbn5HnpErpfkjqrp8oIgaE33mPHnWBL8uIRWpKrZDjgusbcQ\nOMXPDT7DshPv0AqNGhBquqizBx+P89NxsoLu3xKL5B5x0YGuOh56QlyKJLJj\nh7DNR5qg3Cgabs05DdXfXCztACOCh9XD07NDw6P3r+zKEC4Xl1SIvwxa2Pdr\neMYxGYeBw2i/N358aaNEdyKCVKbuKu0x7bwPKZsWiNV3wYfqxm7+h2I1zNmE\n0mHKOm0AbvuULxMC00UYdC6L6jl2GERu4sngcOt6Ehgm8PKpvpz57Krpmwws\nwHapD1+YJDvApW55HHL3p3nDHpsy4tYUfNhmAAyawKhAhw84Z9gAlOlL8e1x\nxe1DQDhL7eJp3JO8foB4dpFg42unVUiGGESBXQpXCMKr5cDIctHM0oLQNN5U\nfiRONPmB4lB4BJU4eLd6jzmrU3KkqfA7UCoJSOHea/1Gbf30l5fihzYMlY9R\n5n2RAoY7JqIdaR3XJdOxuhwYS8bYH/GyuHkLgvcYvOoeborO7anLS8KO3dwh\nWxAz\r\n=aTzZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBWrix+T34FmtAOP9gTZjHcIfiB9dqshya00J2TUEjbgIhAJWxE/gcJjn+OJl+DeMIZ+9XD/H5bsSxFsw4/MDy3EyR"}],"size":2372,"noattachment":false,"key":"/debounce-fn/-/debounce-fn-3.0.0.tgz"},"maintainers":[{"email":"sindresorhus@gmail.com","name":"sindresorhus"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/debounce-fn_3.0.0_1554866682863_0.967627332752387"},"_hasShrinkwrap":false,"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's invoked.\n\nThis can be used to limit the number of calls handled in a constant stream. For example, a media player sending updates every few milliseconds but wants to be handled only 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, 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- [p-debounce](https://github.com/sindresorhus/p-debounce) - Debounce promise-returning & async functions\n","publish_time":1554866683150,"_cnpm_publish_time":1554866683150,"dist-tags":{"latest":"7.0.0"}}