{"name":"debounce-fn","version":"1.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":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["debounce","function","debouncer","fn","func","throttle","delay","invoked"],"dependencies":{"mimic-fn":"^1.1.0"},"devDependencies":{"ava":"*","delay":"^2.0.0","xo":"*"},"gitHead":"58a809e90748e1c6e69ad8f49fbc55ba0593cd95","bugs":{"url":"https://github.com/sindresorhus/debounce-fn/issues"},"homepage":"https://github.com/sindresorhus/debounce-fn#readme","_id":"debounce-fn@1.0.0","_shasum":"12064584ee6769daa7d33298f2b07f974ca9f3b8","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.8.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"12064584ee6769daa7d33298f2b07f974ca9f3b8","tarball":"http://registry-npm.ywwl.com/debounce-fn/download/debounce-fn-1.0.0.tgz","integrity":"sha512-kOowK34YVHvf7DKp959ybOMoOrWK5gFo1WOx4pVaifaKLpVpbDpatv8NI+FkTFET+NGjB4ADo5cv4986PHekoQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDv+UTskf47fHW/DWdooKOT94UdMgzvGpF1YWOw2c9cxgIhAI9uX+Bs3ImVnhcaPaIbcVy2mwBTPwD/sjtsfRuLafhG"}],"size":2125,"noattachment":false,"key":"/debounce-fn/-/debounce-fn-1.0.0.tgz"},"maintainers":[{"email":"sindresorhus@gmail.com","name":"sindresorhus"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/debounce-fn-1.0.0.tgz_1496515107932_0.9102610861882567"},"directories":{},"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":1496515108122,"_cnpm_publish_time":1496515108122,"dist-tags":{"latest":"7.0.0"}}