{"_id":"@ao-framework/portals","_rev":"1-d8bb9cc67e526b03b58a4bab2958c8f6","name":"@ao-framework/portals","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@ao-framework/portals","version":"0.0.1","description":"Portals is a library for dealing with asynchronous event-driven architecture in two ways. The first is the run-of-the-mill event bus with a different way of handling context. The second provides a way of declaring services with multiple endpoints for thos","main":"dist/src/index","types":"dist/src/index.d.ts","scripts":{"test":"jest","dev":"tsc --watch","build":"tsc","doc":"typedoc --out docs src && touch docs/.nojekyll"},"author":{"name":"Josh Miller"},"license":"MIT","devDependencies":{"@types/jest":"^22.2.0","@types/node":"^10.12.12","jest":"^22.4.2","typedoc":"^0.14.2","typescript":"^2.7.2"},"jest":{"testEnvironment":"node","collectCoverage":true,"collectCoverageFrom":["dist/src/**/*.js","!**dist/src/interfaces/**"],"verbose":true,"testURL":"http://localhost/"},"gitHead":"82c100f9f595ba6e4b0d86460dae803b12548f30","_id":"@ao-framework/portals@0.0.1","_npmVersion":"6.4.1","_nodeVersion":"10.15.0","_npmUser":{"name":"josh-josh-miller","email":"wickedhillsmedia@gmail.com"},"dist":{"integrity":"sha512-dLqWtQg9sEYSEQ5tK180HOE+Mh8//r4zyoijUyKSTr+cQk616uYFM8UleH7lgcGUxZ6qPgynXTsgjZbwho4z5A==","shasum":"4d3fa75804b11ad0d0e49842c7ab1899957d3588","tarball":"https://registry.npmjs.org/@ao-framework/portals/-/portals-0.0.1.tgz","fileCount":255,"unpackedSize":780531,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcldKwCRA9TVsSAnZWagAAvCMP/A4IzYRfjWcc7URjn28n\nfKdJ2/v+2RjG8e//YkdnA9Ka9tweA8x21OrbwldUFVkqHplrilpGOSqxVK8C\nnZY1dwwCKgGvDZ+JSg12cyyHyLi6KE0E9+6JzCG0eGjHmR8+QVC5bEtehHUR\n3903WNFtdd8LCa8At8T4BnCCap1pauihvYh9TzmrAkaQWWj39riLTbRDVgHY\nnG6wpD02T8g7RzIHu9jPud3y7yrUPnBqZ9OCHeRzdvv87nKuS5Jz5B30kMIH\nVAIG4IjtwqKcMg8HVsQ34hncAyOOaeSdL6VQYAS89FAZEnvAX+gHYKpJd9FS\nACl4jJRXiuE+p39BKBT9xDta8P81Lk9oYKLD9VJ0DnwBvqN2A31ZTNHTChmw\nlI3fzZmcMSUBO2FUrGlIBQQgEnawtgYq7iZSV1jxf/VQXk3UOvKNVtFiiElJ\nTfMQ0vgoMRCGRLAZ1KZXX8C+dPc5WYJBL3JfYQwAYgpOAItg/OTLhdKEk36B\nhK4G9P7qCjKiXM5wLy3a62H0hJMlQR3R2WzY7uRCAaVukS4dLwGL5THBAvCi\ntuRCS7INR1ona1iWE91EHEZFmkJ0EgOxe9Ukt2jmVTcD4Cgt8jxijxFC433K\nU9UTsRWs0FlvMbyLucigHXHeP7W0DTcD7wbAAHkaJDuGQ9zbxr33KZe7cSxr\nldlN\r\n=KeVn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFpRuxCI5sgMbYnMPLJs/61U30Wm7u8FJjHGfFZx2YqUAiEAj/GImlcsH0cFDHFyL4rk+01bhYaXfKQqPNmzHn/yhRQ="}]},"maintainers":[{"name":"josh-josh-miller","email":"wickedhillsmedia@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/portals_0.0.1_1553322671973_0.16466910626543618"},"_hasShrinkwrap":false}},"time":{"created":"2019-03-23T06:31:11.773Z","0.0.1":"2019-03-23T06:31:12.132Z","modified":"2022-04-04T14:28:26.804Z"},"maintainers":[{"name":"josh-josh-miller","email":"wickedhillsmedia@gmail.com"}],"description":"Portals is a library for dealing with asynchronous event-driven architecture in two ways. The first is the run-of-the-mill event bus with a different way of handling context. The second provides a way of declaring services with multiple endpoints for thos","author":{"name":"Josh Miller"},"license":"MIT","readme":"<p align=\"center\">\n<img width=\"150\" src=\"https://ao-framework.github.io/website/ao.logo.svg\"><br>\n<b>Portals</b>\n</p>\n\n<p align=\"center\"><em>Currently in early development. Breaking changes will occur frequently.</em></p>\n\n**Portals** is a library for dealing with asynchronous event-driven architecture in two ways. The first is the run-of-the-mill event bus with a different way of handling context. The second provides a way of declaring services with multiple endpoints for those that don’t like the “ping-pong” concept in all cases; endpoints are tappable, lockable, and securable.\n\n### Install\n```bash\nnpm install @ao-framework/portals\n```\n\n### Global Reference Location\n```ts\nimport Portals from \"@ao-framework\"\n\nexport default new Portals();\n```\n\n### Event Bus\n```ts\nimport portals from \"./global.reference\"\n\nclass AppState {\n    public constructor() {\n        portals.bus(\"app.state\")\n            .on(\"something\", this.doSomething, this)\n            .on(\"something.else\", this.doSomething, null)\n    }\n\n    public doSomething() {}\n\n    public unregister() {\n        portals.bus(\"app.state\")\n            .removeListener(\"something\", this.doSomething)\n            .removeListener(\"something.else\", this.doSomething)\n    }\n}\n```\n### Service\n```ts\nclass AppState {\n    public constructor() {\n        portals.service(\"app.state\")\n            .route(\"get.users\", this.getUsers, this)//can be changed and tapped\n            .routeTap(\"get.users\", logger.debugSync, logger)\n            .routeLock(\"get.users\", this.getUsers, null)//cannot be changed\n            .routeLockSec(\"get.users\", this.getUsers, null)//cannot be tapped\n    }\n    //...\n}\n\nportals.services(\"app.state\")\n    .request(\"get.users\", ...args)\n    .then(users => console.log(users))\n```\n","readmeFilename":"README.md"}