{"_id":"sb-event-kit","_rev":"17-daed72795fa0b94d7a8b98c843b03760","name":"sb-event-kit","description":"A library for creating disposable components","dist-tags":{"latest":"3.1.0"},"versions":{"1.0.0":{"name":"sb-event-kit","version":"1.0.0","description":"An event for creating disposable components","main":"lib/main.js","jsnext:main":"src/main.js","scripts":{"test":"apm test","compile":"ucompiler go","prepublish":"browserify lib/main.js --standalone EventKit > eventkit.js && git add eventkit.js && git commit -m ':arrow_up: Upgrade dist file'"},"repository":{"type":"git","url":"git+https://github.com/ZoomPK/event-kit.git"},"devDependencies":{"babel-preset-steelbrain":"^1.0.0"},"author":{"name":"steelbrain"},"license":"MIT","bugs":{"url":"https://github.com/ZoomPK/event-kit/issues"},"homepage":"https://github.com/ZoomPK/event-kit#readme","gitHead":"21d0afcdf7ab1e0b51f8d96aa7200fa76e0ec04b","_id":"sb-event-kit@1.0.0","_shasum":"3bad47e5c99d44f300a07f0161a41e88854139aa","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.1.0","_npmUser":{"name":"steelbrain","email":"fakedemail@email.com"},"dist":{"shasum":"3bad47e5c99d44f300a07f0161a41e88854139aa","tarball":"https://registry.npmjs.org/sb-event-kit/-/sb-event-kit-1.0.0.tgz","integrity":"sha512-BigKsp+r1Fjq5PRtHfcQC28yk/nL6gFplWusJ44IvIlL38AIvhINxc8JWC7qeWuF7RA/+N13W1Dsca681C6HXQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2sfeqJVzF8958DUuTRAVXtt9UEdi8z6afFwsrojeOBgIhAPpM8T39adgSnblYsldCuHuGC5H7euP6TuR3o3I2VJWk"}]},"maintainers":[{"name":"steelbrain","email":"fakedemail@email.com"}],"directories":{}},"1.0.1":{"name":"sb-event-kit","version":"1.0.1","description":"An event for creating disposable components","main":"lib/main.js","jsnext:main":"src/main.js","scripts":{"test":"apm test","compile":"ucompiler go","dist":"browserify lib/main.js --standalone EventKit > eventkit.js && git add eventkit.js && git commit -m ':arrow_up: Upgrade dist file'"},"repository":{"type":"git","url":"git+https://github.com/steelbrain/event-kit.git"},"devDependencies":{"babel-preset-steelbrain":"^1.0.0"},"author":{"name":"steelbrain"},"license":"MIT","bugs":{"url":"https://github.com/steelbrain/event-kit/issues"},"homepage":"https://github.com/steelbrain/event-kit#readme","gitHead":"c3538ca4550ddd47f15126e99086133d235cf19d","_id":"sb-event-kit@1.0.1","_shasum":"887377816f0ffa23ef9a90aed408fcb67861d4f5","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.1.0","_npmUser":{"name":"steelbrain","email":"fakedemail@email.com"},"dist":{"shasum":"887377816f0ffa23ef9a90aed408fcb67861d4f5","tarball":"https://registry.npmjs.org/sb-event-kit/-/sb-event-kit-1.0.1.tgz","integrity":"sha512-GMGrun1wRTXfYjXt8kt0H/jDWmpLLzWwnKnwhXoTj/XMs7Bf+zTdr/NZ+Wv65yck3iEsSBYk/wfiNulbI4hXkg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCMqjsATWmwC/scXPoWmhQm67YLFTqQip3Ith4skaOc6gIhAJLeHXH67KjzO7USLqLmoxDbqvFzgCBzI5MK4g+HpL1k"}]},"maintainers":[{"name":"steelbrain","email":"fakedemail@email.com"}],"directories":{}},"1.0.2":{"name":"sb-event-kit","version":"1.0.2","description":"An event for creating disposable components","main":"lib/main.js","jsnext:main":"src/main.js","scripts":{"test":"apm test","compile":"ucompiler go","dist":"browserify lib/main.js --standalone EventKit > eventkit.js && git add eventkit.js && git commit -m ':arrow_up: Upgrade dist file'"},"repository":{"type":"git","url":"git+https://github.com/steelbrain/event-kit.git"},"devDependencies":{"babel-preset-steelbrain":"^1.0.0","babel-preset-steelbrain-legacy":"^1.0.0"},"author":{"name":"steelbrain"},"license":"MIT","bugs":{"url":"https://github.com/steelbrain/event-kit/issues"},"homepage":"https://github.com/steelbrain/event-kit#readme","gitHead":"63842886c7b2e997e1dddce1648e050774f4ce38","_id":"sb-event-kit@1.0.2","_shasum":"0dee0523ff2836ee08bc23e1a86acbd20ef405cb","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.1.0","_npmUser":{"name":"steelbrain","email":"fakedemail@email.com"},"dist":{"shasum":"0dee0523ff2836ee08bc23e1a86acbd20ef405cb","tarball":"https://registry.npmjs.org/sb-event-kit/-/sb-event-kit-1.0.2.tgz","integrity":"sha512-G2tb9ENzJ6sfTRSq4ekmVv2IOjl6vElxaKpjFv6yTZJ+dEbmQGNXv6e4aBBcArn/JLdCQOEMDf3LM1/Uc3NcBA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDBgT7AamyjrcfASM6Cj0sVMIn5W39F8HqyaYUhtUUk+AIgMAsE5ADLLbxFRvbpzpSsehzyxCSl2F3kDGWNLGRX28g="}]},"maintainers":[{"name":"steelbrain","email":"fakedemail@email.com"}],"directories":{}},"1.0.3":{"name":"sb-event-kit","version":"1.0.3","description":"An event for creating disposable components","main":"lib/main.js","jsnext:main":"src/main.js","scripts":{"test":"apm test","compile":"ucompiler go","dist":"browserify lib/main.js --standalone EventKit > eventkit.js && git add eventkit.js && git commit -m ':arrow_up: Upgrade dist file'"},"repository":{"type":"git","url":"git+https://github.com/steelbrain/event-kit.git"},"devDependencies":{"babel-preset-steelbrain":"^1.0.0","babel-preset-steelbrain-legacy":"^1.0.0"},"author":{"name":"steelbrain"},"license":"MIT","bugs":{"url":"https://github.com/steelbrain/event-kit/issues"},"homepage":"https://github.com/steelbrain/event-kit#readme","gitHead":"13636b5651972b8291bb5cb6b989a7327bfa6519","_id":"sb-event-kit@1.0.3","_shasum":"8286e888c7ef4a7fb7da458d75bcea1d6b51b44f","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.4.0","_npmUser":{"name":"steelbrain","email":"de.steelbrain@gmail.com"},"dist":{"shasum":"8286e888c7ef4a7fb7da458d75bcea1d6b51b44f","tarball":"https://registry.npmjs.org/sb-event-kit/-/sb-event-kit-1.0.3.tgz","integrity":"sha512-223VwBc9fggjguRvfBI5xXDHj+zfC58UsqFlSuhdNgwDDjqkEEOGRP24nG6s/aObWTRUY5M5TOsWG9V/da2xcw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG0+2yisSfgrPWFGZnpXF90h4PuzonZDkle0tyKEysB3AiEAsnIbpF9eU6GevcNGOeOor57/1r3KlCIXMuO1p9mlYTI="}]},"maintainers":[{"name":"steelbrain","email":"fakedemail@email.com"}],"directories":{}},"1.1.0":{"name":"sb-event-kit","version":"1.1.0","description":"A library for creating disposable components","main":"lib/main.js","jsnext:main":"src/main.js","scripts":{"test":"apm test","compile":"ucompiler go","dist":"browserify lib/main.js --standalone EventKit | babel --presets es2015 | uglifyjs > eventkit.js && git add eventkit.js && git commit -m ':arrow_up: Upgrade dist file'"},"repository":{"type":"git","url":"git+https://github.com/steelbrain/event-kit.git"},"devDependencies":{},"author":{"name":"steelbrain"},"license":"MIT","bugs":{"url":"https://github.com/steelbrain/event-kit/issues"},"homepage":"https://github.com/steelbrain/event-kit#readme","gitHead":"1e5da75c5f989b5f9bf9601d8c54382de169b6f9","_id":"sb-event-kit@1.1.0","_shasum":"baa54e575d46e4cdcc8346679ce431af8fcd482d","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.5.0","_npmUser":{"name":"steelbrain","email":"de.steelbrain@gmail.com"},"dist":{"shasum":"baa54e575d46e4cdcc8346679ce431af8fcd482d","tarball":"https://registry.npmjs.org/sb-event-kit/-/sb-event-kit-1.1.0.tgz","integrity":"sha512-PvCPzwuXUjD2EY9jMIG3DXJw+ISCTsQSQeHKW+tSVfe5zR4Or7Nr+VsUyPKwhCLjlbjy1RPc9q+nLiq8nnqhuw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBTanpI6jxlOV01eOLdR93I+BGmDZ+QU5bHFC7o/6knBAiEAuPnmi9TpIYO10dYIszWmJGvxDxhM9E3JBGq3ePxDedI="}]},"maintainers":[{"name":"steelbrain","email":"fakedemail@email.com"}],"_npmOperationalInternal":{"host":"packages-6-west.internal.npmjs.com","tmp":"tmp/sb-event-kit-1.1.0.tgz_1455564216665_0.5924307133536786"},"directories":{}},"1.1.1":{"name":"sb-event-kit","version":"1.1.1","description":"A library for creating disposable components","main":"lib/main.js","jsnext:main":"src/main.js","scripts":{"test":"apm test","compile":"ucompiler go","dist-standalone":"browserify lib/main.js --standalone EventKit | babel --presets es2015 | uglifyjs > eventkit-bundle.min.js","dist-library":"browserify -r .:zm-event-kit | babel --presets es2015 | uglifyjs > eventkit-library.min.js","dist":"npm run dist-standalone ; npm run dist-library ; git add eventkit-*.js ; git commit -m ':arrow_up: Upgrade dist file'"},"repository":{"type":"git","url":"git+https://github.com/steelbrain/event-kit.git"},"devDependencies":{},"author":{"name":"steelbrain"},"license":"MIT","bugs":{"url":"https://github.com/steelbrain/event-kit/issues"},"homepage":"https://github.com/steelbrain/event-kit#readme","gitHead":"ef8d29ed5a33d103ce563e6d76975058ec8eb61d","_id":"sb-event-kit@1.1.1","_shasum":"2db6b4dc5bf5442d3fce0a5e1c2ebe6fd53140b3","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.5.0","_npmUser":{"name":"steelbrain","email":"de.steelbrain@gmail.com"},"dist":{"shasum":"2db6b4dc5bf5442d3fce0a5e1c2ebe6fd53140b3","tarball":"https://registry.npmjs.org/sb-event-kit/-/sb-event-kit-1.1.1.tgz","integrity":"sha512-Wmv6c7YSzTixbb4+9/nsZ8qfqPvDxw/FXDP12tpkdPKn7DueXPyfRunWQwhjr51Wc+k6GmtofJccEVMsUga6kA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDtHA0ljQ9XzZXuUdE4kRzqLr9k7UOYkfFQT5jNvQMJCAIhAINBv4hx6je+cYvwtFtlWQMhGZbu5TP3EStDjLV8m4rY"}]},"maintainers":[{"name":"steelbrain","email":"fakedemail@email.com"}],"_npmOperationalInternal":{"host":"packages-5-east.internal.npmjs.com","tmp":"tmp/sb-event-kit-1.1.1.tgz_1455565956011_0.12183620827272534"},"directories":{}},"1.1.2":{"name":"sb-event-kit","version":"1.1.2","description":"A library for creating disposable components","main":"lib/main.js","jsnext:main":"src/main.js","scripts":{"test":"apm test","compile":"ucompiler go","dist-standalone":"browserify lib/main.js --standalone EventKit | babel --presets es2015 | uglifyjs > eventkit-bundle.min.js","dist-library":"browserify -r .:sb-event-kit | babel --presets es2015 | uglifyjs > eventkit-library.min.js","dist":"npm run dist-standalone ; npm run dist-library ; git add eventkit-*.js ; git commit -m ':arrow_up: Upgrade dist file'"},"repository":{"type":"git","url":"git+https://github.com/steelbrain/event-kit.git"},"devDependencies":{},"author":{"name":"steelbrain"},"license":"MIT","bugs":{"url":"https://github.com/steelbrain/event-kit/issues"},"homepage":"https://github.com/steelbrain/event-kit#readme","gitHead":"18449f08bbedb46df3c8190a39fa8f62fc72a395","_id":"sb-event-kit@1.1.2","_shasum":"03c8b513a0f67c47f92c8e7afa4aca14c072854c","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.5.0","_npmUser":{"name":"steelbrain","email":"de.steelbrain@gmail.com"},"dist":{"shasum":"03c8b513a0f67c47f92c8e7afa4aca14c072854c","tarball":"https://registry.npmjs.org/sb-event-kit/-/sb-event-kit-1.1.2.tgz","integrity":"sha512-P8eek6jPLVmSFiEQ8Snf1NtfpxMno1Y6IZqUetKYZbqeZKbigTxZlA+qdgN4qYQ55bjmncmUEKqwrEyi/5SA5Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCWhLS/iR1BpHrJ5u7SdOLgHoLYANBmgXAXStgJQWjshwIgVw+HNLHyuGy/EfGJIzoLM9WK1XoljncLbCrfHZ7dlfM="}]},"maintainers":[{"name":"steelbrain","email":"fakedemail@email.com"}],"_npmOperationalInternal":{"host":"packages-9-west.internal.npmjs.com","tmp":"tmp/sb-event-kit-1.1.2.tgz_1455566364196_0.6508143437094986"},"directories":{}},"2.0.0":{"name":"sb-event-kit","version":"2.0.0","description":"A library for creating disposable components","main":"lib/main.js","scripts":{"test":"apm test","compile":"ucompiler go"},"repository":{"type":"git","url":"git+https://github.com/steelbrain/event-kit.git"},"devDependencies":{},"author":{"name":"steelbrain"},"license":"MIT","bugs":{"url":"https://github.com/steelbrain/event-kit/issues"},"homepage":"https://github.com/steelbrain/event-kit#readme","gitHead":"cb72f2bf84458ba1d6a9e52ebe025fa7facbb10f","_id":"sb-event-kit@2.0.0","_shasum":"10b736812f13a37a473aa6eaa3089b66ab725a7f","_from":".","_npmVersion":"3.8.9","_nodeVersion":"6.2.0","_npmUser":{"name":"steelbrain","email":"de.steelbrain@gmail.com"},"dist":{"shasum":"10b736812f13a37a473aa6eaa3089b66ab725a7f","tarball":"https://registry.npmjs.org/sb-event-kit/-/sb-event-kit-2.0.0.tgz","integrity":"sha512-4iv52/C9+O6QHEyf3yMcmRGFOhdgW3eb5NTwEFqZ1LvQRpuQLpudZ+Eva6nNDY+3Ky2Yb6qSwWgEQTdnpfyRWA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAd8RuvxC4zZ6XsJtnpIQW7sLvQyNEde9XQ5lsSxXUvOAiEAti+PJG9w0bZGY6U/9J/hsjJkEgHONEMGpl6moJlpUgY="}]},"maintainers":[{"name":"steelbrain","email":"fakedemail@email.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/sb-event-kit-2.0.0.tgz_1466783669533_0.9558979070279747"},"directories":{}},"3.0.0":{"name":"sb-event-kit","version":"3.0.0","description":"A library for creating disposable components","main":"lib/main.js","scripts":{"lint":"(flow check) && (eslint .)","test":"apm test","clean":"rm -rf lib","compile":"npm run clean && babel src --out-dir lib","watch":"npm run clean && babel src --out-dir lib --watch"},"repository":{"type":"git","url":"git+https://github.com/steelbrain/event-kit.git"},"devDependencies":{"babel-cli":"^6.14.0","babel-preset-steelbrain":"^4.0.2","eslint-config-steelbrain":"^1.0.4","flow-bin":"^0.32.0","jasmine-fix":"^1.0.1"},"author":{"name":"steelbrain"},"license":"MIT","bugs":{"url":"https://github.com/steelbrain/event-kit/issues"},"homepage":"https://github.com/steelbrain/event-kit#readme","gitHead":"97064779c40e88938ce748401fe24e6fe3ebcc29","_id":"sb-event-kit@3.0.0","_shasum":"0deab6e8a2d9ddad73375e7b83da80bfc9105d24","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.1","_npmUser":{"name":"steelbrain","email":"i@steelbrain.me"},"dist":{"shasum":"0deab6e8a2d9ddad73375e7b83da80bfc9105d24","tarball":"https://registry.npmjs.org/sb-event-kit/-/sb-event-kit-3.0.0.tgz","integrity":"sha512-yOuM4Zjxm84zD9HhNRCdZ/UqP1MhrlCO49WGYfxGUMo2KVFWZOao55x/N1uPrINuhXCbAYqP7fq0mGsR1YKjYw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBD/aqqiF8THoN1OLzdivXgjMKIJcnmNzRtdSugxYihsAiEAiKTZiMR5Hd0rrmoqROxwxNyvbuJkOptPcKfiw2XNamo="}]},"maintainers":[{"name":"steelbrain","email":"fakedemail@email.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/sb-event-kit-3.0.0.tgz_1474134215278_0.04711583931930363"},"directories":{}},"3.1.0":{"name":"sb-event-kit","version":"3.1.0","description":"A library for creating disposable components","main":"lib/main.js","types":"./types/index.d.ts","scripts":{"lint":"(flow check) && (eslint .)","test":"apm test","clean":"rm -rf lib","compile":"npm run clean && babel src --out-dir lib","watch":"npm run clean && babel src --out-dir lib --watch"},"repository":{"type":"git","url":"git+https://github.com/steelbrain/event-kit.git"},"devDependencies":{"babel-cli":"^6.14.0","babel-preset-steelbrain":"^5.0.0","eslint-config-steelbrain":"^3.0.0","flow-bin":"^0.46.0","jasmine-fix":"^1.0.1"},"author":{"name":"steelbrain"},"license":"MIT","bugs":{"url":"https://github.com/steelbrain/event-kit/issues"},"homepage":"https://github.com/steelbrain/event-kit#readme","gitHead":"0fe279a6b128bb70ea53359fd87d301ac54baae1","_id":"sb-event-kit@3.1.0","_nodeVersion":"14.17.0","_npmVersion":"7.17.0","dist":{"integrity":"sha512-66OAKSQHGYEyfsdWZTiig2wt8i0Z/8hDmgsvWtwWh12YRxloSFM+lWAJ6JAeMEOb+pYXop5rFJ0BOD94XwrHRA==","shasum":"2cf0d7ab697be31e8b79784ec62c256cbcfe8bd2","tarball":"https://registry.npmjs.org/sb-event-kit/-/sb-event-kit-3.1.0.tgz","fileCount":20,"unpackedSize":24825,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgzWjWCRA9TVsSAnZWagAAeqUP/1joQbFlu5PxissVMY1f\nsVDtKP5HrDG/Wp0Z4VMYWOA+Apm3QJgRZU0PoBHejafrL6uvVBQ9H5d9EqDo\nf9oIR/whuEWu4ccaG0PEuaUFT7Cyw+VqKj3PPP9ak3bFwlrvppYJ5xzjCLPL\nepTvCOmAj8X9WLvhnKNGw/A0hLXK5a1KkLppq8+3JGafdj1u8wr7of+OhyZy\n6RZALi34Wgnvzi2pzwyAbvj43+K5FIJDRAntxSTGNGJQtc3HP4bltWK3qJ+D\nEzihWdgZSyMB0/AFkQhmsLVd1pTg07KICauMNqzvnSBC1chRu+gjYY8x9KTn\ns5dJWR3N/R72u1Fsw95TnwwIVWp5gO0P70DvR9TEqg1ALjgB4gunebBgj7p0\nYkOyIrYplrF+8IRmfsJVdLNVXAo9qfmDbp6obKlsA03mQATHXmLJ38/JhkeF\napUImd8YmYtOoKZTOomBV2lVP2iI0q/IBfT32NOcg68TrRQek3DYrtGarWkq\nJNAO4T8s75o5V23tUIvUuxhZ06ue/goDjGTV6D3HZKNZV8mLltixPCJNc/im\nSSLksP+Rwx5vjkGWGpluJKAP/HkNLzsC3zNM1Taxv9RKtgKIQBmy6UsTNFDB\nVg42XxKMQLBQRtFmuqqw8X7lDsZn+Z/3L9L/9aQ1QB48jzqYdFCdiT+TNAeR\nLMLl\r\n=Bg+6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCsAio3k5PkDeSdpXAT/RadLZEC31ea+LZXYjDRYOGAtgIgL3ZETHrQN9+UJun9jyiJ8MgDnOiZQHXVxsRhkBtakBI="}]},"_npmUser":{"name":"steelbrain","email":"i@steelbrain.me"},"directories":{},"maintainers":[{"name":"steelbrain","email":"i@steelbrain.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sb-event-kit_3.1.0_1624074454050_0.5935584533320404"},"_hasShrinkwrap":false}},"readme":"Event-Kit\n===========\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/steelbrain/event-kit.svg)](https://greenkeeper.io/)\n\nEvent-Kit is an Application architecture inspired from [Atom's EventKit][1]\n\n#### API\n\n```js\nexport class CompositeDisposable {\n  disposed: boolean;\n\n  constructor(...disposables)\n  add(...disposables)\n  delete(...disposables)\n  clear()\n  dispose()\n}\nexport class Disposable {\n  disposed: boolean;\n\n  constructor(callback)\n  dispose()\n}\nexport class Emitter {\n  disposed: boolean;\n\n  constructor()\n  on(eventName, handler): Disposable\n  off(eventName, handler): void\n  clear(): void\n  emit(eventName, ...params): Promise<Array<any>>\n  dispose(): void\n}\n```\n\n#### Introduction\n\nDisposable architecture has several benefits, the most important one being simplicity and increase in developer productivity.\nThis architecture is something that works everywhere™, you can hot-reload themes, plugins or even the entire app if you follow it.\n\n##### Disposable\n\nDisposables are the base of this architecture, they are objects that have a `dispose` function on them. It is called whenever a\nparent object is being disposed, all of the cleanup code should go there. Also note that every function in the EventKit architecture that accepts a `Disposable`, also accepts a function callback.\n\n##### Emitter\n\nEmitters of this architecture are just like every other emitter but the one thing they have different is that they return\ndisposables when you bind an event, you won't have to call `.removeListener` or `.off` anymore, just dispose the disposable you get\nfrom `.on`.\n\n##### CompositeDisposable\n\nCompositeDisposables are containers of disposables. They implement the disposable interface themselves, so when we do\n`compositedisposable.dispose()` they iterate over all of their disposables and dispose them as well.\n\n##### Named Events\n\nThis is more of a method naming convention than an interface but it's still important. Traditional event emitters have APIs\nlike this\n\n```js\nclass SomeEmitter {\n  on(eventName, callback)\n}\n```\n\nthat `eventName` can be any string, therefore it breeds confusion, developers sometimes make a typo somewhere and spend hours\nfinding it, they also \"accidently\" type one letter uppercase or all letters uppercase and it doesn't work.\n\nIt also makes it difficult to find all available event names and we end up digging the docs.\n\nDisposable architecture solves this with functions that act as event handlers, like\n\n```js\nclass App {\n  onDidLoad(callback): Disposable\n  onDidReload(callback): Disposable\n  OnWillBlowUp(callback): Disposable\n}\n```\n\n\n#### Example\n\nHere's an example app using the Disposable Architecture\n\n```js\n// app.js\nimport App from './lib/app'\n\nconst app = App.create()\n\nApp.activate().catch(function(e) {\n  console.log(e.stack)\n  app.dispose()\n})\n```\n\n```js\n// lib/app.js\nimport { Disposable, CompositeDisposable } from 'sb-event-kit'\nimport { Server } from './server'\nimport Database from './db'\n\nconst debug = require('debug')('APP:MAIN')\n\nexport class App {\n  constructor() {\n    this.subscriptions = new CompositeDisposable()\n    this.db = new Database()\n    this.server = new Server()\n\n    this.subscriptions.add(this.db)\n    this.subscriptions.add(this.server)\n\n    this.server.onDidClientConnect(function() {\n      debug('Client :: Connected')\n    })\n  }\n  activate() {\n    return Promise.all([\n      this.db.activate(),\n      this.server.activate()\n    ])\n  }\n  dispose() {\n    this.subscriptions.dispose()\n  }\n}\n```\n```js\n// lib/db.js\nimport MongoDB from 'some-mongo-library'\nimport { Database as DatabaseConfig } from '../config'\n\nexport class Database {\n  constructor() {\n    this.connection = new MongoDB()\n  }\n  activate() {\n    return this.connection.connect(DatabaseConfig)\n  }\n  query(query) {\n    return this.connection.query(query)\n  }\n  dispose() {\n    this.connection.unref()\n  }\n}\n```\n```js\n// lib/server.js\nimport { Emitter, Disposable, CompositeDisposable } from 'sb-event-kit'\nimport HTTPServer from 'some-server-library'\nimport { Server as ServerConfig } from '../config'\n\nexport class Server {\n  constructor() {\n    this.subscriptions = new CompositeDisposable()\n    this.emitter = new Emitter()\n    this.connection = new HTTPServer()\n\n    this.subscriptions.add(this.emitter)\n    this.subscriptions.add(() => {\n      this.connection.unref()\n    })\n\n    this.connection.on('client', connection => {\n      this.emitter.emit('did-client-connect', connection)\n    })\n  }\n  activate() {\n    return this.connection.listen(ServerConfig)\n  }\n  onDidClientConnect(callback) {\n    return this.emitter.on('did-client-connect', callback)\n  }\n  dispose() {\n    this.subscriptions.dispose()\n  }\n}\n```\n\n#### License\nThis project is licensed under the terms of MIT License. See the License file for more info.\n\n[1]:https://github.com/atom/event-kit\n","maintainers":[{"name":"steelbrain","email":"i@steelbrain.me"}],"time":{"modified":"2022-06-26T16:16:49.390Z","created":"2015-12-03T13:00:48.103Z","1.0.0":"2015-12-03T13:00:48.103Z","1.0.1":"2015-12-03T13:30:22.117Z","1.0.2":"2015-12-03T14:23:29.041Z","1.0.3":"2016-01-31T14:48:33.311Z","1.1.0":"2016-02-15T19:23:40.668Z","1.1.1":"2016-02-15T19:52:38.190Z","1.1.2":"2016-02-15T19:59:28.044Z","2.0.0":"2016-06-24T15:54:31.873Z","3.0.0":"2016-09-17T17:43:35.513Z","3.1.0":"2021-06-19T03:47:34.247Z"},"homepage":"https://github.com/steelbrain/event-kit#readme","repository":{"type":"git","url":"git+https://github.com/steelbrain/event-kit.git"},"author":{"name":"steelbrain"},"bugs":{"url":"https://github.com/steelbrain/event-kit/issues"},"license":"MIT","readmeFilename":"README.md","users":{"goliatone":true}}