{"versions":{"1.0.0":{"name":"@arction/eventer","version":"1.0.0","description":"Simple and fast event emitter.","keywords":["emitter","event"],"homepage":"https://github.com/Arction/Eventer#README","bugs":{"url":"https://github.com/Arction/Eventer/issues"},"repository":{"type":"git","url":"git+ssh://git@github.com/Arction/Eventer.git"},"license":"MIT","author":{"name":"Arction Ltd."},"main":"dist/eventer.js","module":"dist/eventer.es.js","types":"dist/eventer.d.ts","scripts":{"build":"gulp build","ci:lint":"gulp lint","ci:test":"gulp test","ci:watch":"gulp ciWatch","docs":"gulp docs","lint":"gulp lintWatch","prepare":"gulp build","test":"gulp testWatch","version":"gulp docs"},"devDependencies":{"@types/chai":"^4.1.7","@types/mocha":"^5.2.7","@types/node":"^12.0.12","@types/sinon":"^7.0.13","chai":"^4.2.0","del":"^5.0.0","gulp":"^4.0.2","gulp-mocha":"^6.0.0","gulp-terser":"^1.2.0","gulp-tslint":"^8.1.4","gulp-typedoc":"^2.2.2","mocha":"^6.1.4","rollup":"^1.16.4","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-typescript2":"^0.21.2","sinon":"^7.3.2","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2","typescript":"^3.5.2"},"publishConfig":{"tag":"beta"},"iife":"dist/eventer.iife.js","gitHead":"f3be4e1eb8b89424134162ecc0952194691e4d88","_id":"@arction/eventer@1.0.0","_nodeVersion":"12.4.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-/TVTLZPYX7gBv2X67PyRcQ7X2d7E0ToPT0YGFymLVhzZiAiVN9qUA/4XRinUqLvfHj2IKFBlAeqP0ide+8MOlA==","shasum":"d1e8de7204b3e4555b0bb20f3b34224274e7c063","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@arction/eventer/-/eventer-1.0.0.tgz","fileCount":10,"unpackedSize":63670,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdHfReCRA9TVsSAnZWagAAz6UP/2JAKgiDpPe9PKOPwkfy\nx6ERx5POykUAlhKD+HO58U+92KCJoQRdOtknvGgjLovn75FQvkytUjd8ayOC\n5HGShhFGqnbUiRDtMVB+0sQWWF1si2E/4KOFO6WeURebC+eFKx+Mfh6/Hhix\n30WJ1tFUaBzv604zc0kD66jy9b+hMZ+Pu9fXTlppWRWOm+566KVWITChLH9Q\nl4ldDB3T8HNB2xuBiAKnWno+5DnmuwdqzxEFiL5xuiT+D+7tHYDLK8HzfCVu\nAjUVOD/5madZ1xcc9GbN/39wbG4BbnaYSdb8l9F/0XFKdtJyeYjig5pJGMhd\nZUp2HkZBx0Lsu33Okj8PRm0jgaUjmeisMP/VZOei81EfplOlgHHBB2xT/+EK\nPIG9FO/7tEEAaK12fbPBcOW/ELWLKjeM8uocnkEv3/MUX2d1opbWdfDW0cQ8\nATx5zVXlvjKalgI4FIErVR2m4zEcMo9Ft+5mkFuxE7FSo8h0xko21DpfRJkH\n/nM5N1RO8+sTqkm9eQrufaFrlOqvGwdeZR5lXaD/s81vW4stg8po3vGcfybD\nuczkRFdU/mvZr7N+/QvjgXAYUQr2efFu0F2LmBKTXN28+rQY4DtQmR9a0P9V\naZqHdBeYKHDTWrXpUGtHlSdQbBlp1a/oaKnmaj5ypOLkOf/9IXeFSLJMtbcr\n9X1b\r\n=a99i\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDUm2V/X4gCw7steDxGlMUGI9Pv6vkJAGZ/Cii7LliaUwIhAOg8KzcTwMg8au1JKNonZLt456vCTb5q8IlOtuK2HLTa"}]},"maintainers":[{"name":"anonymous","email":"terho.hakkinen@arction.com"},{"name":"anonymous","email":"ilkka.kuosmanen@arction.com"}],"_npmUser":{"name":"anonymous","email":"ilkka.kuosmanen@arction.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eventer_1.0.0_1562244190036_0.9010408781902424"},"_hasShrinkwrap":false,"contributors":[]},"1.0.1":{"name":"@arction/eventer","version":"1.0.1","description":"Simple and fast event emitter.","keywords":["emitter","event"],"homepage":"https://github.com/Arction/Eventer#README","bugs":{"url":"https://github.com/Arction/Eventer/issues"},"repository":{"type":"git","url":"git+ssh://git@github.com/Arction/Eventer.git"},"license":"MIT","author":{"name":"Arction Ltd."},"main":"dist/eventer.js","module":"dist/eventer.es.js","types":"dist/eventer.d.ts","scripts":{"build":"gulp build","ci:lint":"gulp lint","ci:test":"gulp test","ci:watch":"gulp ciWatch","docs":"gulp docs","lint":"gulp lintWatch","prepare":"gulp build","test":"gulp testWatch","version":"gulp docs"},"devDependencies":{"@types/chai":"^4.1.7","@types/mocha":"^5.2.7","@types/node":"^12.6.9","@types/sinon":"^7.0.13","chai":"^4.2.0","del":"^5.0.0","gulp":"^4.0.2","gulp-mocha":"^6.0.0","gulp-terser":"^1.2.0","gulp-tslint":"^8.1.4","gulp-typedoc":"^2.2.2","mocha":"^6.2.0","rollup":"^1.18.0","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-typescript2":"^0.22.1","sinon":"^7.4.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.15.0","typescript":"^3.5.3"},"publishConfig":{"tag":"beta"},"iife":"dist/eventer.iife.js","gitHead":"b24ebe1973651317c9044304b9b745b1f1738166","_id":"@arction/eventer@1.0.1","_nodeVersion":"12.4.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-/443gMPcZwt+BSH5cy2/sJlYis2zT0IUbllboi/e0Ye4uk58SUloxjMecWjp2sJ7IBCGGpduaE8I73mMQmJGvw==","shasum":"1b11560cf056db03c82d48643f03f28c98379bb4","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@arction/eventer/-/eventer-1.0.1.tgz","fileCount":11,"unpackedSize":64254,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdR+B0CRA9TVsSAnZWagAAqmoQAIw5HTblVPLS1SidlxP2\nD9lOS01E3gAFNSum/pdQ5qJQnUljnjpKJxRJDfTxlkdcEW4gSCd1vgPWjMsO\nimx2a78u+NPvbvW8+umWSsWbcw7HdBKu+/J12cyop77qcKk0LlIUW+6MxXdg\nCkdesG070VGZ9IrtxKFNdRoyuG6Cs74z5BsqPlVR/KvQHcb4tzhNzzIqSINr\nxSw+d/151oBvfFTz3QwDhkPrkNTzZzfL1Tt9p7Rx5l5YnQtGTN11Zaov6lHj\nziueC6i2qV+3oT4CWSPze+3zA211MjnUGHDzTtiWlrO22Q3FoNFxlRdioIbY\nOTq1yrPlqyTuXzJW7c2BEnuISaZ84m7F93UCTVCZbqDSfYnGF2HuqmBO3S4I\nI/klQmsprjbHmrQht5Cy18vDVRuqbp0ykdVWevvn0YwbDAsRgQ/l0/7G+5XW\nX+drO6+NcYdRRQ+EpRSfTh7LYyXThFliHTPC38xUHni+geFSOljnAvCcUl9x\nYIqJNvUg/zOUeqn7Yf/8a7Ilr+ZHGpnVm0ZAANd/1dKnL1VHn0WTsmQcFYOA\nKOXQLgmVN9j3j9lBZVkSJLztObzQgd3tXMAcmKPH6T/ThYigNOPnDH+A3ehQ\nq2B9fpxtqNWKMx8MB8Ip3e3nVH/bIjvQyNocB/xGcN2lVZXEIuiuLj6kGGZs\nI0Cn\r\n=QbhC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAELT8xEf1oyOziGTF4fgUg/tkkbcl8d00b7opQzhKmUAiAN5pt/h8ywTMezoVrkR8ZGolLVomKp3Xm7ZM7dsVyAjw=="}]},"maintainers":[{"email":"terho.hakkinen@arction.com","name":"anonymous"},{"email":"ville.itapelto@arction.com","name":"anonymous"},{"email":"ilkka.kuosmanen@arction.com","name":"anonymous"}],"_npmUser":{"name":"anonymous","email":"ilkka.kuosmanen@arction.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eventer_1.0.1_1564991603566_0.876939853208546"},"_hasShrinkwrap":false,"contributors":[]},"1.0.2":{"name":"@arction/eventer","version":"1.0.2","description":"Simple and fast event emitter.","keywords":["emitter","event"],"homepage":"https://github.com/Arction/Eventer#README","bugs":{"url":"https://github.com/Arction/Eventer/issues"},"repository":{"type":"git","url":"git+ssh://git@github.com/Arction/Eventer.git"},"license":"MIT","author":{"name":"Arction Ltd."},"main":"dist/eventer.js","module":"dist/eventer.es.js","types":"dist/eventer.d.ts","scripts":{"build":"gulp build","ci:lint":"gulp lint","ci:test":"gulp test","ci:watch":"gulp ciWatch","docs":"gulp docs","lint":"gulp lintWatch","prepare":"gulp build","test":"gulp testWatch","version":"gulp docs"},"devDependencies":{"@types/chai":"^4.3.1","@types/mocha":"^9.1.1","@types/node":"^13.13.4","@types/sinon":"^10.0.11","chai":"^4.3.6","del":"^6.0.0","gulp":"^4.0.2","gulp-mocha":"^8.0.0","gulp-terser":"^2.1.0","gulp-tslint":"^8.1.4","gulp-typedoc":"2.2.9","mocha":"^10.0.0","rollup":"^2.72.0","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-typescript2":"^0.31.2","sinon":"^13.0.2","ts-node":"^10.7.0","tslint":"^6.1.3","typedoc":"0.19.2","typescript":"4.0.8"},"publishConfig":{"tag":"beta"},"iife":"dist/eventer.iife.js","readmeFilename":"README.md","gitHead":"b872ac31555a942be4b84fa97d39b02145f802f4","_id":"@arction/eventer@1.0.2","_nodeVersion":"16.13.0","_npmVersion":"8.1.3","dist":{"integrity":"sha512-pn43bapEuf+V//UrAod6J0BuC64XdNIYmaCH/kMjhyVcOh8QGVflcLq30NP4qNhLvCXd5JFdo5ZLwq3qg6HkmQ==","shasum":"33b1673268547780a30d5d81001b4f10c1adab02","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@arction/eventer/-/eventer-1.0.2.tgz","fileCount":11,"unpackedSize":70584,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCUnaZZc7qA8sufrotZd32739tBIWlpzwRxHEDxtmko3wIhAK2hxWZ76ZGF3rPNQAVM+yRXYXNWqRjOvu+KlAEt2pRo"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKqzEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoRuQ//Rrrbc+vechzyvtRRF6RS1jwJiujuVH1Did7KlZQ9CcLfnMkx\r\nPZIB6CkEC+dT7PP+TQ5PTGbabS2PwCwevml3det85LhbTK7GFCkFbk7CUWhP\r\nMlQa7xNCAtZcZvugLrKYliu4H3H3No9YCdF5Jzcb5Rmvged9QLZ9dFjWgntp\r\nzC3dL9aDdteLk4XnNE1xfys0Ht3ryczcTn4BV/XpslU8JhlVDRr0QUBAc7dK\r\nchSDXkaGMo1sDML81JsdWPm61p7fxoTPoKwF5FQEWtkfS40wA8Wt/S4pVH/6\r\ngre8ZaDreaBaF9WuYlwyUOyFYpUKu0rxsd0MglF9ugTV94KSxrZI9+iITkJU\r\nsyk/+qyeF0cqbShPMq2o13Kzh/pzOwXpw0T58JmJ4cmOnz0uZRUCmrkL7+OR\r\ngRM4IH4xg2oTmY3r7rx5hberhJ538w6QT2nN8ZkbSvFltbLhOI4wxKxXxmEz\r\n5iBfvA9QQD8bCroAQscGe4VsJkycZD9RcvHEDFufjVVYos9sg3pXBd5YejAL\r\nuaWktLqpmiZK1Bty5kR6LHqnimv9YsX0gSI4+aqJMmLqhYYHVymxmhxsJEXf\r\njFJArTm73TqgpgIT2GmCnMU+2dGAzlaS8b+gym8cpys+H7FdZcID5csknNvf\r\nck/n+JS596xHq/cDpeGlhy70VKL++nF2Q7I=\r\n=NYmY\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"anonymous","email":"ilkka.kuosmanen@lightningchart.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"niilo.keinanen@gmail.com"},{"name":"anonymous","email":"ilkka.kuosmanen@lightningchart.com"},{"name":"anonymous","email":"terho.hakkinen@lightningchart.com"},{"name":"anonymous","email":"ville.itapelto@arction.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eventer_1.0.2_1663741124308_0.509038345738474"},"_hasShrinkwrap":false,"contributors":[]}},"dist-tags":{"beta":"1.0.2","latest":"1.0.2"},"name":"@arction/eventer","time":{"created":"2022-01-27T08:29:25.751Z","1.0.0":"2019-07-04T12:43:10.190Z","modified":"2024-02-09T11:02:24.622Z","1.0.1":"2019-08-05T07:53:23.730Z","1.0.2":"2022-09-21T06:18:44.495Z"},"readme":"# Eventer\r\n\r\nSimple and fast event emitter library. Subscription is based on a unique Token, which can be used to unsubscribe from the topic.\r\n\r\nThe Eventer is used in LightningChart<sup>&#174;</sup> JS charting library. [https://www.arction.com/](https://www.arction.com/)\r\n\r\n## Installation\r\n\r\n`npm install --save @arction/eventer`\r\n\r\n## Documentation\r\n\r\nOnline documentation is available at [arction.github.io/eventer](https://arction.github.io/Eventer/)\r\n\r\n## Getting started\r\n\r\n```ts\r\nimport { Eventer } from '@arction/eventer'\r\n\r\nconst eventer = new Eventer()\r\n\r\n// new topic is created, handler is added as the first subscriber to the topic\r\nconst token1 = eventer.on('topic1', () => console.log('I am called from topic1'))\r\n// 'topic1' already exists, so new listener is simply added to existing collection of handlers\r\nconst token2 = eventer.on('topic1', () => console.log('I am also called from topic1'))\r\n// new collection of handlers is created for the second topic\r\n// the function is added to it\r\neventer.on('topic2', () => console.log('I am called from topic2'))\r\n\r\neventer.emit('topic1')\r\n// calls two functions which listen to the event\r\n//\r\n// outputs:\r\n//    I am called from topic1\r\n//    I am also called from topic1\r\n\r\neventer.emit('topic2')\r\n// calls single functions which listen to the event\r\n//\r\n// outputs:\r\n//    I am called from topic2\r\n\r\n// remove the second listener from the first topic by token \r\neventer.off(token2)\r\n\r\neventer.emit('topic1')\r\n// calls single functions which listen to the event\r\n//\r\n// outputs:\r\n//    I am called from topic1\r\n\r\n// remove all listeners from all topics\r\neventer.allOff()\r\n\r\neventer.emit('topic2')\r\n// nothing happened, since all subscriptions were terminated\r\n```\r\n\r\n### Subscribe to topic\r\n\r\nSubscribing to a topic is easy.\r\n\r\n```ts\r\neventer.on('topic', ()=>{ console.log('Topic handler') })\r\n```\r\n\r\nMultiple subscriptions to a single topic can exist.\r\n\r\n```ts\r\neventer.on('topic', ()=>{ console.log('Topic handler') })\r\neventer.on('topic2', ()=>{ console.log('Topic 2 handler') })\r\neventer.on('topic3', ()=>{ console.log('Topic 3 handler') })\r\n```\r\n\r\n### Unsubscribe from topic\r\n\r\nYou can unsubscribe from a single topic by using the *Token* returned by eventer when you subscribed to the topic.\r\n\r\n```ts\r\nconst token = eventer.on('topic', ()=>{ console.log('Topic handler') })\r\n\r\neventer.off(token)\r\n```\r\n\r\nYou can also unsubscibe all listeners from a topic.\r\n\r\n```ts\r\neventer.topicOff('topic')\r\n```\r\n\r\nIt is also possible to unsubscribe all topics and all listeners.\r\n\r\n```ts\r\neventer.allOff()\r\n```\r\n\r\n### Emiting events\r\n\r\nEvents can be emitted for a topic. The emit can contain 0 or more arguments that will be provided to the topic listeners.\r\n\r\n```ts\r\neventer.emit('topic')\r\n\r\neventer.on('topic2', ( arg1, arg2 ) => console.log( arg1, arg2 ))\r\n\r\neventer.emit('topic2', 'Hello ', 'World')\r\n```\r\n\r\n## Development instructions\r\n\r\nThe project is developed using TypeScript. Build system of the project heavily relies on Node.js. Dependencies are managed with *npm*, therefore, remember to run **npm install** before starting of anything else. \r\n\r\nThere are several *npm scripts*, which are used for development process:\r\n\r\n| Name     | Command          | Description              |\r\n| ---------|------------------|--------------------------|\r\n| build    | npm run build    | run build system\r\n| test     | npm test         | run tests and watch      |\r\n| lint     | npm run lint     | run static analyzer and watch\r\n| docs     | npm run docs     | generate typedoc documentation\r\n| ci:test  | npm run ci:test  | run tests once\r\n| ci:lint  | npm run ci:lint  | run static analyzer once\r\n| ci:watch | npm run ci:watch | run CI circle and watch","users":{}}