{"_id":"debounce-collect","_rev":"1745509","name":"debounce-collect","description":"Makes a function execute only once in a given interval.","dist-tags":{"latest":"1.0.2"},"maintainers":[{"name":"rstacruz","email":"rico@ricostacruz.com"}],"time":{"modified":"2026-11-19T14:13:50.000Z","created":"2015-09-21T08:28:52.393Z","1.0.2":"2015-09-21T09:00:16.913Z","1.0.0":"2015-09-21T08:28:52.393Z"},"users":{},"author":{"name":"Rico Sta. Cruz","email":"rico@ricostacruz.com"},"repository":{"type":"git","url":"git+https://github.com/rstacruz/debounce-collect.git"},"versions":{"1.0.2":{"name":"debounce-collect","version":"1.0.2","description":"Makes a function execute only once in a given interval.","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/rstacruz/debounce-collect.git"},"author":{"name":"Rico Sta. Cruz","email":"rico@ricostacruz.com"},"license":"MIT","bugs":{"url":"https://github.com/rstacruz/debounce-collect/issues"},"homepage":"https://github.com/rstacruz/debounce-collect#readme","devDependencies":{"expect":"^1.10.0","mocha":"^2.3.3","mocha-standard":"^1.0.0","standard":"^5.3.1"},"gitHead":"f39824cc305dc12ee0ba7e86897186fd6cd78ee0","_id":"debounce-collect@1.0.2","_shasum":"2a19065936d51bf2e19729b1aa10bea5c96a33cf","_from":".","_npmVersion":"2.13.3","_nodeVersion":"3.3.1","_npmUser":{"name":"rstacruz","email":"rico@ricostacruz.com"},"dist":{"shasum":"2a19065936d51bf2e19729b1aa10bea5c96a33cf","tarball":"http://registry-npm.ywwl.com/debounce-collect/download/debounce-collect-1.0.2.tgz","integrity":"sha512-ZPIxD3WD6LSKe7WIlBh+v3i0Fn8DqxUl49Uka1IA+u3CJh1Mld3pOCvBl5EgJiLnVVGBHK0Vg7esZNB6K/JgIg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHvc0nHffS8HJtZknoW9kvqHYGIrllFVOYovKPEOLGuyAiANoe1gz7TpPKIbhthI4i9dvaGXOgFfVdmBZloWZ5betQ=="}],"size":2661,"noattachment":false,"key":"/debounce-collect/-/debounce-collect-1.0.2.tgz"},"maintainers":[{"name":"rstacruz","email":"rico@ricostacruz.com"}],"publish_time":1442826016913,"_cnpm_publish_time":1442826016913},"1.0.0":{"name":"debounce-collect","version":"1.0.0","description":"Makes a function execute only once in a given interval.","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/rstacruz/debounce-collect.git"},"author":{"name":"Rico Sta. Cruz","email":"rico@ricostacruz.com"},"license":"MIT","bugs":{"url":"https://github.com/rstacruz/debounce-collect/issues"},"homepage":"https://github.com/rstacruz/debounce-collect#readme","devDependencies":{"expect":"^1.10.0","mocha":"^2.3.3","mocha-standard":"^1.0.0","standard":"^5.3.1"},"gitHead":"cb195138d95a65b3eebc9ec88e443b517b6c9900","_id":"debounce-collect@1.0.0","_shasum":"11589826f7bc233de00abe4783bf9cc6d071830a","_from":".","_npmVersion":"2.13.3","_nodeVersion":"3.3.1","_npmUser":{"name":"rstacruz","email":"rico@ricostacruz.com"},"dist":{"shasum":"11589826f7bc233de00abe4783bf9cc6d071830a","tarball":"http://registry-npm.ywwl.com/debounce-collect/download/debounce-collect-1.0.0.tgz","integrity":"sha512-gG1D8vo9P8No72Ep5Y4+BvatI+VKizMD0/4J6UQLfloyRh2kuDdV7bJQJhWxGUOEqg0BBpYbh8vBDJWTEapFPw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEn4gxLaDeligpjrY11reD7tfTxY7S0vWI5OHnr3/8ADAiAsdKUtSTvcS2Dzeqqtzw61uZl4YsNOp9nGw2Z76XmIIQ=="}],"size":2163,"noattachment":false,"key":"/debounce-collect/-/debounce-collect-1.0.0.tgz"},"maintainers":[{"name":"rstacruz","email":"rico@ricostacruz.com"}],"publish_time":1442824132393,"_cnpm_publish_time":1442824132393}},"readme":"# debounce-collect\n\nAn implementation of debounce. Unlike [underscore]'s debounce, this one\ncollects arguments of all calls.\n\nThis is based on underscore's [implementation](https://github.com/jashkenas/underscore/blob/1.8.3/underscore.js#L813-L847) of debounce.\n\n[![Status](https://travis-ci.org/rstacruz/debounce-collect.svg?branch=master)](https://travis-ci.org/rstacruz/debounce-collect \"See test builds\")\n\n[underscore]: http://underscorejs.org/\n\n## Usage\n\nDebounce-collect is available as an npm package.\n\n```js\nvar debounce = require('debounce-collect')\n```\n\nWhen used outside a CommonJS environment, it's accessible as `global.debounceCollect`.\n\n## Description\n\n```js\ndebounce(function, wait, [immediate])\n```\n\nCreates and returns a new debounced version of the passed function which will\npostpone its execution until after `wait` milliseconds have elapsed since the\nlast time it was invoked. Useful for implementing behavior that should only\nhappen after the input has stopped arriving. For example: rendering a preview\nof a Markdown comment, recalculating a layout after the window has stopped\nbeing resized, and so on.\n\nPass *true* for the `immediate` argument to cause `debounce()` to trigger the function\non the leading instead of the trailing edge of the `wait` interval. Useful in\ncircumstances like preventing accidental double-clicks on a \"submit\" button\nfrom firing a second time. \n\n### Differences from `_.debounce`\n\nThe resulting function will be called with an array of all function arguments\nfor all calls.\n\n## Example\n\n```js\n// this will call the update function:\n//\n//    update('change', 'file1.txt')\n//    update('change', 'file2.txt')\n//\nchokidar.watch('.')\n  .on('all', debounce(update, 50))\n\nfunction update (argsList) {\n  console.log(argsList)\n\n  // result:\n  // [\n  //   [ 'change', 'file1.txt' ],\n  //   [ 'change', 'file2.txt' ]\n  // ]\n}\n```\n\n## Thanks\n\n**debounce-collect** © 2015+, Rico Sta. Cruz. Released under the [MIT] License.<br>\nAuthored and maintained by Rico Sta. Cruz with help from contributors ([list][contributors]).\n\n> [ricostacruz.com](http://ricostacruz.com) &nbsp;&middot;&nbsp;\n> GitHub [@rstacruz](https://github.com/rstacruz) &nbsp;&middot;&nbsp;\n> Twitter [@rstacruz](https://twitter.com/rstacruz)\n\n[MIT]: http://mit-license.org/\n[contributors]: http://github.com/rstacruz/debounce-collect/contributors\n","_attachments":{},"homepage":"https://github.com/rstacruz/debounce-collect#readme","bugs":{"url":"https://github.com/rstacruz/debounce-collect/issues"},"license":"MIT"}