{"name":"debounce-fn","version":"4.0.0","description":"Debounce a function","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/debounce-fn.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"engines":{"node":">=10"},"scripts":{"test":"xo && ava && tsd"},"keywords":["debounce","function","debouncer","fn","func","throttle","delay","invoked"],"dependencies":{"mimic-fn":"^3.0.0"},"devDependencies":{"ava":"^1.4.1","delay":"^4.2.0","tsd":"^0.11.0","xo":"^0.26.1"},"gitHead":"5c4e89ba031e039b7d23eafce148689b4a591cd4","bugs":{"url":"https://github.com/sindresorhus/debounce-fn/issues"},"homepage":"https://github.com/sindresorhus/debounce-fn#readme","_id":"debounce-fn@4.0.0","_nodeVersion":"10.18.1","_npmVersion":"6.13.7","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-8pYCQiL9Xdcg0UPSD3d+0KMlOjp+KGU5EPwYddgzQ7DATsg4fuUDjQtsYLmWjnk2obnNHgV3vE2Y4jejSOJVBQ==","shasum":"ed76d206d8a50e60de0dd66d494d82835ffe61c7","tarball":"http://registry-npm.ywwl.com/debounce-fn/download/debounce-fn-4.0.0.tgz","fileCount":5,"unpackedSize":6367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeTU2tCRA9TVsSAnZWagAA62MP/28tspKl+p4ptFFy4GFs\nQI372fOKtOilU61NFsk9pPQ37GKtbCOMT4vA2yWTfQVHPQORgfr6XnpnAijZ\n5xZDrEPbtC61zv4E5FoZGl0OykSlyFDCdJoVne9MeeCZfQwHhIaYUAcRsjrF\nOJ1hK6ZVRip8qovf2/IXVXU3luDX1tl6F3LlQQj/pXZXRjZKP+bpBkMVOyba\nRRRhjT40CvIspubyiW/QCHdgFdDHVn9Aev2tClgqgairUnlCZR+pDt1vaDIe\nYMllk/pT/3wgQIHHX4hL3cQzxFsNWl6j8tn2hLTyb2OjlnLHaLfyFNq5j+MT\nlu8c6dBDD1QP9jYvgzLjvBvRiZi3Gor8ZYk3hhq6CtQLwEQi/H1T6fQ1sw5+\ne0MQWCJNFYGdmUautjDoA5aiGVAFr9cveu8r3G4l97TmPZEJEAGGVqRkubGK\nCMduHyx+SEoSR4klBOgohobGxV+6ZtS/VoI64UGzLMOlXQZsRB+7f+E6cwHh\nNfmGqyBMCjkp6J+7hXaCBJiEWyU33fzC/0Pla5o7SdVfRxOVz/YsPcIqsRDa\n4+RlbYQgrAkJPYoM7kFwDunHW6K5AfV3bdTlRmfmPD/7cAU4eMj2SwEXEK+X\n1h5XmE4EcZoy3fJv8sd7/oieqB7Swt0kGxlfGyTNN/tmlyAkXZAn6OfcxUJ3\nP4mf\r\n=NKyG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJwXOCXPwO1ud8l2fdn1vChPLu2tuQJIJZcbPc3ju0TgIgQ95Ad+4kX0fBNqdaa313dKYmieJ5xwXn54uVrEnU0GE="}],"size":2560,"noattachment":false,"key":"/debounce-fn/-/debounce-fn-4.0.0.tgz"},"maintainers":[{"email":"sindresorhus@gmail.com","name":"sindresorhus"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/debounce-fn_4.0.0_1582124460689_0.35779952403669846"},"_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":1582124460795,"_cnpm_publish_time":1582124460795,"dist-tags":{"latest":"7.0.0"}}