{"name":"debounce-fn","version":"0.0.0","description":"Return a debounced version of the given function","main":"index.js","scripts":{"test":"node test"},"keywords":["debounce","debounced"],"repository":{"url":"git@github.com:azer/debounce-fn.git","type":"git"},"author":"azer","license":"BSD","devDependencies":{"prova":"^1.14.0"},"_id":"debounce-fn@0.0.0","_npmVersion":"0.0.0-fake","_nodeVersion":"0.0.0-fake","_shasum":"43c0a6e0b2c39af90bd05d546fe8c48f552c0dfe","_npmUser":{"name":"npm","email":"support@npmjs.com"},"_from":".","dist":{"shasum":"43c0a6e0b2c39af90bd05d546fe8c48f552c0dfe","tarball":"http://registry-npm.ywwl.com/debounce-fn/download/debounce-fn-0.0.0.tgz","integrity":"sha512-N8nOqnA2KxfjZbA62HsHDqyJwOf0OrrK34SF0jCrJvEkIJstSQJ+A5JMZBwLGMPDyO5AeunJP3pSWzQ+oIV9hg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEhE9BjIYfeWnAIUPQF3SO2kFsVxct6aCp/GfUbE6KAGAiEAz3wignoGHwgfsSKGyu3ZAYvd2L+d80L2TVAP4TkMuKU="}],"size":770,"noattachment":false,"key":"/debounce-fn/-/debounce-fn-0.0.0.tgz"},"maintainers":[{"name":"npm","email":"npm@npmjs.com"}],"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":1407192373182,"_cnpm_publish_time":1407192373182,"dist-tags":{"latest":"7.0.0"}}