{"_id":"@audiopump/on","_rev":"1-c952d69af06ccea1a7f2f8b54418ece7","name":"@audiopump/on","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@audiopump/on","type":"module","version":"1.0.0","description":"Wrapper for addEventListener that enables ergonomic listener removal","main":"index.js","scripts":{"test":"node test.js"},"keywords":["addEventListener","events","event","EventTarget"],"author":{"name":"Brad Isbell","email":"brad@audiopump.co"},"license":"MIT","_id":"@audiopump/on@1.0.0","_nodeVersion":"18.2.0","_npmVersion":"8.9.0","dist":{"integrity":"sha512-46JFdb2JtPrPPejBmpLd3rLPtYwgi/LRX7FONZpDSgodn7Deu3CDvvzD/TDOgofumFUJBQcP0iS7DkKvcMD26Q==","shasum":"57bcb1618e3372cccfb5b5e6d5738e2f0b5b96b8","tarball":"https://registry.npmjs.org/@audiopump/on/-/on-1.0.0.tgz","fileCount":4,"unpackedSize":3746,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID3wJiGwaQlKW0niEzZr64lr8Dit3xNLAAn9Y92avj36AiEAu0DQ7MicuDGzoaS8zGolTqjBRW/qD4nKZufUSAzqBA0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJijH8rACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpb7A/9GY1KK16xL9oRDrl/NlnYAl6/VZBulAyiH+CvcIE3Yvsu1pr+\r\nC5hGviMLjuocUYktUFw2V1Tf3DTTxtdemaZQI+0D+SoLW8miA8mEb4vZRjUq\r\nmvzCT0vKgKTbHoYyj5XjxNV6/VLXhgu+0+2vREXjsRoJ9qwBa5XcpRKz1XNW\r\n7FA5en/V9ajXWMXisABWCSSSQh0HoJ0mVdS8C7i9DpB5GUINUFvP9g7HXvSo\r\nsc4rYAPbSOw66aXOU4yh8LBVSkEgadCaJz2YjFBgSlmPZ4E4XAfxoGLkMt6V\r\npvItklM/OcnEmN7yoJsSyhdbwDw2X3tPWnZaWMVScUwFdRE8qDIahmjHNLRC\r\nPXyyVU4jdRqCHYM0vVUthMz6bBEEUCffQzvb8atvgMS7T5ZTLY19J9JAq6qb\r\nCQl/ewUuShEF99DimMfqTLsfhDMydct2/VFuIS/6TcoQTDYhcMs1nQf1Ywg8\r\nP054XFfqt0Rw9EV23BVPAba0dEp8+MPVuyVS7A685u2P2NgWl71efwF0aoPQ\r\nfhpP0pHBPau6Sl/IL3iJrXNfFsqKJhnIAD7jjFw+nU1IPk1vro7jaClsSov2\r\nWV9fd5+tfo4c6icBZrXq0gf+ox/JxYa0Znxdyf+2cu3lNWT+OG9xPkik2CVR\r\nD5P3MINR5kO6wMQJxWh0uy6ZQtflIVD6jkA=\r\n=GHC5\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"bradisbell","email":"brad@musatcha.com"},"directories":{},"maintainers":[{"name":"bradisbell","email":"brad@musatcha.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/on_1.0.0_1653374762833_0.022580346725656675"},"_hasShrinkwrap":false},"1.0.1":{"name":"@audiopump/on","type":"module","version":"1.0.1","description":"Wrapper for addEventListener that enables ergonomic listener removal","main":"index.js","scripts":{"test":"node test.js"},"keywords":["addEventListener","events","event","EventTarget"],"author":{"name":"Brad Isbell","email":"brad@audiopump.co"},"license":"MIT","_id":"@audiopump/on@1.0.1","_nodeVersion":"18.2.0","_npmVersion":"8.9.0","dist":{"integrity":"sha512-bQTxPTkzJntQS9Ud4Utokj3XVZAypTODhCCffiz0r5yozZuIj2nQZMUt5VcWHq9qtY8wbkXxC5GsBuYNirwLAA==","shasum":"8da795166b405ee56d9e994c24b825d27c1cf851","tarball":"https://registry.npmjs.org/@audiopump/on/-/on-1.0.1.tgz","fileCount":4,"unpackedSize":3747,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICD5IDrmaR1JF7xZg1OqDrPJcpP/gzcZkiEW59BSQRRbAiEAtp7FQwQ8ipotvQy8NHxlJxyw54Kad8mEmG107j0ao30="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJijIAZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrAVg/+IGQACnXJE+Ecd/lo2zJ/GMiRYgUar63/iMGxXu2jkVR+SPTA\r\nixAcKntThee9BedX0nqlwF1zT90lWbY9Q22Y22rFEW+oxxclReCHBFSz4dgj\r\nKyPkszcd2ixwa5FJ1iNO7Dbuet0KJBsEQyEWK18qXQ/EVoU8EqyUY5RO/byB\r\n4UvFflCMGdqXJSWgmYgxwIOsAXRem/H5yt1KVL4+jv0Bm23OnKtDRiPh3oDw\r\n31wOaVw6lfi6fWKLNh+7Pr62UXRxZr5UbNt+q3QnuOnOkQKbRA0BdJRat8PM\r\nfhmPmbxAPcGL7LnIXCjWOfk0FPbSLkdu3e3W/tQsjQCY5JoY23xpCaL1ylTr\r\nw9wLphETc00EBCjQ1mUq1oNT9iuhfJ4nQTzd6Qts41TeAvzCtgd57Uf2KmvI\r\nyRfeo2Kv20LZQkhETzV6QV1qiDPEm4itjGOsRr1yCUdsrb0WS3oC/8atH6gY\r\nPJ5wOG37wKiOrXji62R+PEXYOkhJfCI3aPpwvz5BTTPpbvfZKFsmaKscI0rR\r\nDHBIcViwQ1p/o9u+5VB+zPe1nhHB9jSmxbrtWa2CTQ4WSQ2fwUN9cHpOGVMU\r\nRCB3lPwMH7+JXK5e/TLTXg1VMeIbqVWlC/VMDbfDPMxnZr/nT9XWWJOoZ+HB\r\nW3X59FfxtJG5ozMb7tqyixaTdvH4PP9NoiU=\r\n=E8IF\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"bradisbell","email":"brad@musatcha.com"},"directories":{},"maintainers":[{"name":"bradisbell","email":"brad@musatcha.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/on_1.0.1_1653375001493_0.29179403036337814"},"_hasShrinkwrap":false}},"time":{"created":"2022-05-24T06:46:02.773Z","1.0.0":"2022-05-24T06:46:03.005Z","modified":"2022-05-24T06:50:01.805Z","1.0.1":"2022-05-24T06:50:01.669Z"},"maintainers":[{"name":"bradisbell","email":"brad@musatcha.com"}],"description":"Wrapper for addEventListener that enables ergonomic listener removal","keywords":["addEventListener","events","event","EventTarget"],"author":{"name":"Brad Isbell","email":"brad@audiopump.co"},"license":"MIT","readme":"on\n--\n\nDo you like to use anonymous functions with event handlers, but get annoyed when\nyou have to remove those event handlers later?  Yeah?  Then this module is for you!\n\nConsider the following:\n\n```javascript\nbuttonEl.addEventListener('click', (e) => {\n  alert('Click!');\n});\n```\n\nIf you wanted to remove this handler later, you'd need a function reference:\n\n```javascript\nfunction onButtonClick(e) {\n  alert('Click!');\n}\n\nbuttonEl.addEventListener('click', onButtonClick);\n\n// Then, to remove:\nbuttonEl.removeEventListener('click', onButtonClick);\n```\n\nIf you have a bunch of these, or if you don't like having function references\ninside of function references inside of function references, maybe you could use\na different method.\n\nThis module adds your event listener *and* returns a function bound to the\nappropriate `removeEventListener` call, all in one go.  For example:\n\n```javascript\nconst remover = on(buttonEl, 'click', (e) => {\n  alert('Click!');\n});\n\n// Then, to remove:\nremover();\n```\n\nSimple!\n\n## Installation\n\n```\nnpm install @audiopump/on\n```\n\n## Usage\n\n```javascript\nimport on from 'on';\n```\n\n## License\n\nCopyright (c) 2022 AudioPump, Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","readmeFilename":"README.md"}