{"_id":"d-bounce","_rev":"7-48e57175a4bda2fd2e1ead6107136415","name":"d-bounce","description":"Javascript debounce tool","dist-tags":{"latest":"0.0.5"},"versions":{"0.0.1":{"name":"d-bounce","version":"0.0.1","description":"Javascript debounce tool","main":"dist/d-bounce.js","module":"src/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/fixiecoder/d-bounce.git"},"keywords":["debounce","browser","node"],"author":{"name":"Colin Adams"},"license":"MIT","bugs":{"url":"https://github.com/fixiecoder/d-bounce/issues"},"homepage":"https://github.com/fixiecoder/d-bounce#readme","devDependencies":{"babel-core":"^6.25.0","babel-loader":"^7.0.0","babel-preset-es2015":"^6.24.1","webpack":"^2.6.1"},"gitHead":"0cbbdadfd026185445ba05146205785ffcf7a493","_id":"d-bounce@0.0.1","_shasum":"e9e090e7b1600d4a46d442461bfe1ab71419506b","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"fixiecoder","email":"contact@colinadams.co"},"dist":{"shasum":"e9e090e7b1600d4a46d442461bfe1ab71419506b","tarball":"https://registry.npmjs.org/d-bounce/-/d-bounce-0.0.1.tgz","integrity":"sha512-GY25E1r2ZczWI3G6MmL7J8EdgsWM4B1fivNHKl3YxRahT6thELXe5ewRN4yihODHO+lOCECnrCmAyeTpLgZePg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDqeMXsVQyw75hfYVY48xGRQA1XLqaH50lPHGlgLPDUawIgIHRe9ry1VcFPY1LKVKZIHGTJzWON19sKNMUsa2sj0og="}]},"maintainers":[{"name":"fixiecoder","email":"contact@colinadams.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/d-bounce-0.0.1.tgz_1497303746404_0.7122532471548766"}},"0.0.2":{"name":"d-bounce","version":"0.0.2","description":"Javascript debounce tool","main":"dist/d-bounce.js","module":"src/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/fixiecoder/d-bounce.git"},"keywords":["debounce","browser","node"],"author":{"name":"Colin Adams"},"license":"MIT","bugs":{"url":"https://github.com/fixiecoder/d-bounce/issues"},"homepage":"https://github.com/fixiecoder/d-bounce#readme","devDependencies":{"babel-core":"^6.25.0","babel-loader":"^7.0.0","babel-preset-es2015":"^6.24.1","webpack":"^2.6.1"},"gitHead":"8647e99bfd378427eafcb0ad9e2ca33365a18e73","_id":"d-bounce@0.0.2","_shasum":"8fd2a4f72e5ed2c58332bbf10cbfe13637e536d0","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"fixiecoder","email":"contact@colinadams.co"},"dist":{"shasum":"8fd2a4f72e5ed2c58332bbf10cbfe13637e536d0","tarball":"https://registry.npmjs.org/d-bounce/-/d-bounce-0.0.2.tgz","integrity":"sha512-wMjjQLK0RqSdjpY1fchd2lyFyU/iWEBjd+NxPvvn1G9atocPJbaf1B+DTkxGNn/ynwA/e612Or/A1sM4o+Fe2g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHQ5ZwZpxIg4U5/Fk7eickeJjJZmIkMJxY19TaM1NZd2AiEAicocGe8/Eapsr95CfOj5raS7LZCUqyn650o4UsSw72Y="}]},"maintainers":[{"name":"fixiecoder","email":"contact@colinadams.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/d-bounce-0.0.2.tgz_1497304078186_0.9305585911497474"}},"0.0.3":{"name":"d-bounce","version":"0.0.3","description":"Javascript debounce tool","main":"dist/d-bounce.js","module":"src/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/fixiecoder/d-bounce.git"},"keywords":["debounce","browser","node"],"author":{"name":"Colin Adams"},"license":"MIT","bugs":{"url":"https://github.com/fixiecoder/d-bounce/issues"},"homepage":"https://github.com/fixiecoder/d-bounce#readme","devDependencies":{"babel-core":"^6.25.0","babel-loader":"^7.0.0","babel-preset-es2015":"^6.24.1","webpack":"^2.6.1"},"gitHead":"b59672cc9578151839482e15359bf17c593e387c","_id":"d-bounce@0.0.3","_shasum":"4799f24b776df04ac4ba158f06b9da4bfaf2e5a4","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"fixiecoder","email":"contact@colinadams.co"},"dist":{"shasum":"4799f24b776df04ac4ba158f06b9da4bfaf2e5a4","tarball":"https://registry.npmjs.org/d-bounce/-/d-bounce-0.0.3.tgz","integrity":"sha512-HZGdjFFxslaGrW/4n9BLufW60VMQdw/SszCqSS+m3Rs6ZxPuvXb+kzZQiUH1ouoBZsJ6FyWT58GvB9J/+6lZFg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG4Gc3VCNihTlAPlqw3BInSHwFJMgjEodljRSOOZDaF3AiEA6lSQS24aQRRaJFEJUdHnCl+ESl28M61tQQidtNyEe/w="}]},"maintainers":[{"name":"fixiecoder","email":"contact@colinadams.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/d-bounce-0.0.3.tgz_1497387165016_0.5930478384252638"}},"0.0.4":{"name":"d-bounce","version":"0.0.4","description":"Javascript debounce tool","main":"dist/d-bounce.js","module":"src/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/fixiecoder/d-bounce.git"},"keywords":["debounce","browser","node"],"author":{"name":"Colin Adams"},"license":"MIT","bugs":{"url":"https://github.com/fixiecoder/d-bounce/issues"},"homepage":"https://github.com/fixiecoder/d-bounce#readme","devDependencies":{"babel-core":"^6.25.0","babel-loader":"^7.0.0","babel-preset-es2015":"^6.24.1","webpack":"^2.6.1"},"gitHead":"66c5f1e8a044be281aa4934f6194c26f9aab5f71","_id":"d-bounce@0.0.4","_shasum":"777e888d1f8d891f646fc18f50c6af223ed9c405","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"fixiecoder","email":"contact@colinadams.co"},"dist":{"shasum":"777e888d1f8d891f646fc18f50c6af223ed9c405","tarball":"https://registry.npmjs.org/d-bounce/-/d-bounce-0.0.4.tgz","integrity":"sha512-qX2fXXNfKj+8pVHN4jyphHCjOJrKKGeqOQV+kfMMqXtShuYSBx/R2nqYKzungNY09G6B3hef0fGi9DTQve+QNg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDcm4DIGH+2NcvhQPOeIHXFpRyCsvrym0gKd5HmCpOUTwIhAJv8p03MSO/QTrEvt+mzRZ5xwv+qIMOfU7Wx33zrZm5r"}]},"maintainers":[{"name":"fixiecoder","email":"contact@colinadams.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/d-bounce-0.0.4.tgz_1497387333512_0.39602446579374373"}},"0.0.5":{"name":"d-bounce","version":"0.0.5","description":"Javascript debounce tool","main":"dist/d-bounce.js","module":"src/index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/fixiecoder/d-bounce.git"},"keywords":["debounce","browser","node"],"author":{"name":"Colin Adams"},"license":"MIT","bugs":{"url":"https://github.com/fixiecoder/d-bounce/issues"},"homepage":"https://github.com/fixiecoder/d-bounce#readme","devDependencies":{"babel-core":"^6.25.0","babel-loader":"^7.0.0","babel-preset-es2015":"^6.24.1","chai":"^4.0.2","mocha":"^3.4.2","sinon":"^2.3.4","webpack":"^2.6.1"},"gitHead":"dc1f70994b7a5a29285b1b4b4236a2671090d6a2","_id":"d-bounce@0.0.5","_shasum":"17fb6392c8b971c203aae0ce83812923fb14dc0b","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"fixiecoder","email":"contact@colinadams.co"},"dist":{"shasum":"17fb6392c8b971c203aae0ce83812923fb14dc0b","tarball":"https://registry.npmjs.org/d-bounce/-/d-bounce-0.0.5.tgz","integrity":"sha512-NL4s2f6Q9t0xInCRcuh4ZTDwh03QosUoP3peb2oVGIFW8xex3BfOcQ/JqUpzi2G2GyFy354pDzdLcYYkyhW58w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAXJkcI9ndRvd5g+XZM1XvjoFqu7wjkoUq6a/s9H/vSOAiBo6URBQkaWAC+gMc898EwyEkCYDbFzGmGPRTnwv9t0sA=="}]},"maintainers":[{"name":"fixiecoder","email":"contact@colinadams.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/d-bounce-0.0.5.tgz_1497390225530_0.3365284230094403"}}},"readme":"# d-bounce\nSimple javascript debounce tool\n\n## Getting started\n\n```shell\n$ npm install d-bounce\n```\n\n```javascript\n// import d-bounce\nconst dBounce = require('d-bounce');\n\n// callback function to be invoked after delay\nfunction sayWord(word) {\n    console.log(word);\n}\n\n// list of arguments to be passed to the callback function on invocation\nconst arguments = ['bounced'];\n\n// this will console.log the word 'bounced' after 3 seconds\ndBounce(sayWord, 'say-word-debounce', 3000, arguments);\n\n/*\n * if dBounce is called again within 3 seconds \n * with the same identifier string 'say-word-debounce' \n * the clock will reset and another 3 seconds will be \n * waited before the callback is invoked. \n */\n```\n\n## API\n\nd-bounce accepts 4 arguments although only one is necessary.\n\ndBounce(`callback` [, `identifier` [, `delay` [, `arguments`]]])\n\n### `callback` (`Function` or `null` or `undefined`) required\n\nThe function that you wish to be invoked after the delay provided dBounce is not called again with the same `identifier`.\n\nPassing either `null` or `undefined` will cancel the debounce for the given identifier.\n\n```javascript\nfunction exampleCallback() {\n    console.log('I am an example');\n}\ndBounce(exampleCallback, 'example-debounce', 3000, arguments);\n\ndBounce(null, 'example-debounce');\n// debounce will be cancelled before it invokes the callback\n```\n\n### `identifier` (`String`) optional default: `'default'`\n\nA string identifier used to associate each attempted invocation with other attempted invocations. calls to d-bounce are linked to each other by the `identifier`. This means that you could pass a different callback function every time you call dBounce, using the same `identifier`, and dBounce will reset the clock on the `delay`.\n\n```javascript\n// create a debpunced function with the identifier 'example-debounce-1'\ndBounce(() => console.log('callback 1'), 'example-debounce-1');\n\n// create a second debpunced function with the identifier 'example-debounce-2'\ndBounce(() => console.log('callback 2'), 'example-debounce-2');\n\n// both callbacks will be invoked as they have different identifiers.\n// one has no effect on the other\n```\n\nThe last callback function that dBounce is called with when the `delay` is satisfied will be the function that gets invoked.\n\n```javascript\ndBounce(() => console.log('callback 1'), 'example-debounce');\ndBounce(() => console.log('callback 2'), 'example-debounce');\n// the the second callback that logs out 'callback 2' will be the only one that is invoked.\n```\n\n### `delay` (`Number`) optional - default: `300`\ndefault: `300`\n\nThe amount of time waited by dBounce before invoking the callback, provided debounce is not called again with the same `identifier`.\n\n### `arguments` (`Array`) optional - default: `[]`\n\nAn array of arguments to be passed to the callback upon invocation.\n\n```javascript\nfunction callback(one, two, three) {\n    console.log(one);\n    console.log(two);\n    console.log(three);\n}\n\nconst arguments = ['first arg', 'second arg', 'third arg'];\n\ndBounce(callback, 'example-debounce', 1000, arguments);\n\n/*\n *  After 1 second the callback will be invoked and \n *  the console will log out the following\n *\n *  first arg\n *  second arg\n *  third arg\n */\n```\n\n## Testing\n\n```shell\n$ npm test\n```\n","maintainers":[{"name":"fixiecoder","email":"contact@colinadams.co"}],"time":{"modified":"2022-06-14T07:24:53.937Z","created":"2017-06-12T21:42:27.341Z","0.0.1":"2017-06-12T21:42:27.341Z","0.0.2":"2017-06-12T21:47:59.126Z","0.0.3":"2017-06-13T20:52:45.982Z","0.0.4":"2017-06-13T20:55:34.588Z","0.0.5":"2017-06-13T21:43:46.445Z"},"homepage":"https://github.com/fixiecoder/d-bounce#readme","keywords":["debounce","browser","node"],"repository":{"type":"git","url":"git+https://github.com/fixiecoder/d-bounce.git"},"author":{"name":"Colin Adams"},"bugs":{"url":"https://github.com/fixiecoder/d-bounce/issues"},"license":"MIT","readmeFilename":"README.md","users":{"fixiecoder":true}}