{"name":"debounce-fn","version":"3.0.1","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":"361f38540676490dd75934199e31e81d1e17a96e","bugs":{"url":"https://github.com/sindresorhus/debounce-fn/issues"},"homepage":"https://github.com/sindresorhus/debounce-fn#readme","_id":"debounce-fn@3.0.1","_nodeVersion":"8.16.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-aBoJh5AhpqlRoHZjHmOzZlRx+wz2xVwGL9rjs+Kj0EWUrL4/h4K7OD176thl2Tdoqui/AaA4xhHrNArGLAaI3Q==","shasum":"034afe8b904d985d1ec1aa589cd15f388741d680","tarball":"http://registry-npm.ywwl.com/debounce-fn/download/debounce-fn-3.0.1.tgz","fileCount":5,"unpackedSize":5562,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcvIejCRA9TVsSAnZWagAAm/MP/302+tQeNBziTwGEpGe0\n/ViyIhVMKTqhs9USYsEubbxR7fHgvL0+gwjwOQX2hVFTlt0MV5PVD/joH/gP\nL7mgPFKyEOT+y6tIw6XlBVKLStCJ8iLwa50ig51BJlNZcApX6Mz3coDB4rWH\nAiso8Z3EMOw8IXWobyGjGewcmjrRdqHceCYQKjOT6LdErmUfWpe54qrggR6g\nZKtT3fPw6pKAINlD6KOkftG6nypmGCQ1WSAJYcfWcglA4u0RJG0V4bxGk/BS\nrD8Yn8xsDTznHPI9FANXLNPtfcI6xa6dFkKw59CQ8HYDRWGg1ognZbFoNxb9\n2QEswDxaE0t2NWXl1J/Yo4STBzotemoRsonVKKqzhMcM1S163+ustCS60TJU\n9l4gU7WdLpKkrxMNQzh9iMK4fhDWBGI7fsv9Rx7K6seDPuAfw0QO13MXTH0V\n9UmnXvaBK2tm4mSQw/AjM3DtPF7id0ew9CXI7qjpYQ5XoRBbicUfsRHnxrgI\nPd0JkLyK+r66sNQMjbEelERPWJz3x/+hmr/K7hs31+KUt2j5Fh+GB26UwMP9\n3yFGge8NCTDV/58OBy1QjkMATEFE90+tcepaYMRk8FuVLkdRI9yFaMBLtD9l\nPPUfY6M4UYbyuIcuXSd/hqGtX0Kj3K18o8xV3Qs3T2hh2KRu6GJvN+dZu13V\nDsU0\r\n=BPGW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGZcZ+5JZaQVlMvmpIoJWNfZF5B/J6mE50BMxScir4N2AiA9E7/1/6XYv5zjByG2J+gSH1cufUt61PDwT0UE9jLb6Q=="}],"size":2420,"noattachment":false,"key":"/debounce-fn/-/debounce-fn-3.0.1.tgz"},"maintainers":[{"email":"sindresorhus@gmail.com","name":"sindresorhus"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/debounce-fn_3.0.1_1555859363183_0.8911269799856609"},"_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":1555859363291,"_cnpm_publish_time":1555859363291,"dist-tags":{"latest":"7.0.0"}}