{"_id":"last-one-wins","_rev":"8-93344af8095ee9552e56b49ba9826b9e","name":"last-one-wins","description":"Make sure the last sync call to an async function is executed after all previous ones have finished","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.0":{"name":"last-one-wins","version":"1.0.0","description":"Make sure the last sync call to an async function is executed after all previous ones have finished","main":"index.js","dependencies":{},"devDependencies":{"standard":"^5.4.1","tape":"^4.2.2"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"https://github.com/mafintosh/last-one-wins.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/last-one-wins/issues"},"homepage":"https://github.com/mafintosh/last-one-wins","gitHead":"fa71adc952ffcd21a0851ce2355f709ecf45c34c","_id":"last-one-wins@1.0.0","_shasum":"681287cd1d7c48f45d9f2c3644d2d4fec8c3a1e5","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.2","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"681287cd1d7c48f45d9f2c3644d2d4fec8c3a1e5","tarball":"https://registry.npmjs.org/last-one-wins/-/last-one-wins-1.0.0.tgz","integrity":"sha512-l2WV7P0HThE2Asz/tIKmpEzcp9vyiqJK6auf/RskrcFI5WvYaRgEa3cNxkjIvWW1JCnKvN1b66HqZuQxyR3Kkw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDZ8OFbIixBitGoFJ1FroyXFYbRsrF4c7k6p886NqDqlAiEA68hfr4UPrwRXBrNr6rBSIo/GbNge+2+TjDBfA6Vt3+k="}]},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}]},"1.0.1":{"name":"last-one-wins","version":"1.0.1","description":"Make sure the last sync call to an async function is executed after all previous ones have finished","main":"index.js","dependencies":{},"devDependencies":{"standard":"^5.4.1","tape":"^4.2.2"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"https://github.com/mafintosh/last-one-wins.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/last-one-wins/issues"},"homepage":"https://github.com/mafintosh/last-one-wins","gitHead":"f162f176fa260fed45741e01e3c8772f8653e3d5","_id":"last-one-wins@1.0.1","_shasum":"89bf510d0b2777e4076ba8f13e7fd6c718235b49","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.3","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"89bf510d0b2777e4076ba8f13e7fd6c718235b49","tarball":"https://registry.npmjs.org/last-one-wins/-/last-one-wins-1.0.1.tgz","integrity":"sha512-VpFhqUSUEXpgHpwn8YCqO/1s23uwT8BCzIBDsHw6DKJaieFpJ7CZhRd+C6TYkHyFamZ/lfaIc8kMNlOuaLPZDw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEGG/DWCUwtkJo0frdubhAF/0IH+hfO5nxdbDB7bPwC1AiBbgjwz2bSvBCwSCqdzKshr16UxhbCsRjs8/+qyD5JH9w=="}]},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}]},"1.0.2":{"name":"last-one-wins","version":"1.0.2","description":"Make sure the last sync call to an async function is executed after all previous ones have finished","main":"index.js","dependencies":{},"devDependencies":{"standard":"^5.4.1","tape":"^4.2.2"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"https://github.com/mafintosh/last-one-wins.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/last-one-wins/issues"},"homepage":"https://github.com/mafintosh/last-one-wins","gitHead":"7738338b5146df6f709c8495f93391d66d8af997","_id":"last-one-wins@1.0.2","_shasum":"e8d5117db6e072cb919112e648d2cf843454780c","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.3","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"e8d5117db6e072cb919112e648d2cf843454780c","tarball":"https://registry.npmjs.org/last-one-wins/-/last-one-wins-1.0.2.tgz","integrity":"sha512-ETyNR9KqBFV/iK3CTJV+RXwikVP1x9jHhJfn47OkqtiQpL8tsryyaqih9IWRQBKrrM+P01DnSJyohDGMF6q5wA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFcnNXMK4LcBNupe/GvaC/OFR4ETgpCs6v8ZzJrRK0AoAiBpLyuBEhEkjtjmrbYwy6CiomL/otqDUnBEacWHRxNRKQ=="}]},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}]},"1.0.3":{"name":"last-one-wins","version":"1.0.3","description":"Make sure the last sync call to an async function is executed after all previous ones have finished","main":"index.js","dependencies":{},"devDependencies":{"standard":"^5.4.1","tape":"^4.2.2"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"https://github.com/mafintosh/last-one-wins.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/last-one-wins/issues"},"homepage":"https://github.com/mafintosh/last-one-wins","gitHead":"a14280ec0c237c20a8be905dfd82b073c99b4bc7","_id":"last-one-wins@1.0.3","_shasum":"d678979048e0ed420340f0b3ae8fc7058db2acbd","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.3","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"d678979048e0ed420340f0b3ae8fc7058db2acbd","tarball":"https://registry.npmjs.org/last-one-wins/-/last-one-wins-1.0.3.tgz","integrity":"sha512-yfiROkHA+uqvG6KfhG0ocirLXMJqXCkPWnWDeK8RsB9S/xmvao77NSxjypvIvAaUt039NRkVhA0uWi7xEz9hxQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBN9AqHubDCal6cmnWq2sv88DuS4V9A89j4RFYBORuddAiB8a01yzZw9EsB+//HyCOhRgnCFb66+U9iLtSj+Ct7P/w=="}]},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}]},"1.0.4":{"name":"last-one-wins","version":"1.0.4","description":"Make sure the last sync call to an async function is executed after all previous ones have finished","main":"index.js","dependencies":{},"devDependencies":{"standard":"^5.4.1","tape":"^4.2.2"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"https://github.com/mafintosh/last-one-wins.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/last-one-wins/issues"},"homepage":"https://github.com/mafintosh/last-one-wins","gitHead":"84189d018e77044b06b565d9a78d67eebc035aff","_id":"last-one-wins@1.0.4","_shasum":"c1bfd0cbcb46790ec9156b8d1aee8fcb86cda22a","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.3","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"c1bfd0cbcb46790ec9156b8d1aee8fcb86cda22a","tarball":"https://registry.npmjs.org/last-one-wins/-/last-one-wins-1.0.4.tgz","integrity":"sha512-t+KLJFkHPQk8lfN6WBOiGkiUXoub+gnb2XTYI2P3aiISL+94xgZ1vgz1SXN/N4hthuOoLXarXfBZPUruyjQtfA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB1S2haU5Uj4PjAKJXAOs/jPPbX9YCcilT7tT4UusHnYAiAZCLZdXhz/1nVfT4F8DXj+j+6vDTjEq2q5+1LWqikgMg=="}]},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}]}},"readme":"# last-one-wins\n\nMake sure the last sync call to an async function is executed after all previous ones have finished\n\n```\nnpm install last-one-wins\n```\n\n[![build status](http://img.shields.io/travis/mafintosh/last-one-wins.svg?style=flat)](http://travis-ci.org/mafintosh/last-one-wins)\n\n## Usage\n\n``` js\nvar low = require('last-one-wins')\n\nvar pick = low(function (num, cb) {\n  setTimeout(function () {\n    console.log('picked', num)\n    cb()\n  }, Math.floor(Math.random() * 100))\n})\n\npick(1)\npick(2)\npick(3)\npick(4)\npick(5) // this one will always win since its called the last\n```\n\nCalling the above will print out\n\n```\npicked 1\npicked 5\n```\n\n## API\n\n#### `var fn = low(asyncWorker)`\n\nWrap a async function to make sure that the last sync call to that\nfunction is executed after any previous calls. Note that not all calls\nare executed - only the last one is guaranteed to be executed.\n\n`fn` and `asyncWorker` should have the signature `(value, cb)`\n\n## Use with leveldb\n\nThis module is useful if you want sync a value to a leveldb and want to\nmake sure the latest version of that value is the one written. For example\n\n``` js\nvar update = low(function (val, cb) {\n  db.put('my-key', val, cb)\n})\n\nupdate('a')\nupdate('b')\nupdate('c')\n```\n\nIs guaranteed to always write `c` to the key `my-key`.\n\n## License\n\nMIT\n","maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"time":{"modified":"2022-06-19T10:46:07.235Z","created":"2015-11-28T04:43:49.897Z","1.0.0":"2015-11-28T04:43:49.897Z","1.0.1":"2016-01-13T23:30:58.757Z","1.0.2":"2016-01-13T23:55:15.965Z","1.0.3":"2016-01-25T16:35:32.565Z","1.0.4":"2016-01-30T00:03:41.889Z"},"homepage":"https://github.com/mafintosh/last-one-wins","repository":{"type":"git","url":"https://github.com/mafintosh/last-one-wins.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"bugs":{"url":"https://github.com/mafintosh/last-one-wins/issues"},"license":"MIT","readmeFilename":"README.md","users":{"hugozap":true}}