{"id":21296672,"url":"https://github.com/eccenca/ecc-messagebus","last_synced_at":"2025-03-15T17:26:02.481Z","repository":{"id":57110521,"uuid":"58635467","full_name":"eccenca/ecc-messagebus","owner":"eccenca","description":"Eccenca Message Bus for inter-component and in-app messaging","archived":false,"fork":false,"pushed_at":"2018-02-06T07:41:24.000Z","size":147,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":14,"default_branch":"develop","last_synced_at":"2025-02-20T01:52:58.507Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eccenca.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-12T11:25:08.000Z","updated_at":"2018-08-16T21:46:39.000Z","dependencies_parsed_at":"2022-08-20T22:20:35.184Z","dependency_job_id":null,"html_url":"https://github.com/eccenca/ecc-messagebus","commit_stats":null,"previous_names":["elds/ecc-messagebus"],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eccenca%2Fecc-messagebus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eccenca%2Fecc-messagebus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eccenca%2Fecc-messagebus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eccenca%2Fecc-messagebus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eccenca","download_url":"https://codeload.github.com/eccenca/ecc-messagebus/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243764522,"owners_count":20344429,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-21T14:28:51.543Z","updated_at":"2025-03-15T17:26:02.452Z","avatar_url":"https://github.com/eccenca.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Eccenca Message Bus for inter-component and in-app communications\n\n`ecc-messagebus` exports a normal rxmq.js instance but with a set of additional functions.\nFor convenience it also exports `Rx` so that we can use a fixed `Rx` version in all components.\n\n## Using Rx\n\n```js\nimport {Rx} from 'ecc-messagebus';\n\nvar source = Rx.Observable.just(42);\n\nvar subscription = source.subscribe(\n  function (x) {\n    console.log(`Next: ${x}');\n  },\n  function (err) {\n    console.log(`Error: ${err}`);\n  },\n  function () {\n    console.log('Completed');\n  });\n\n// =\u003e Next: 42\n// =\u003e Completed\n\n```\n\n## Using request-response\n\nRequest-response pattern can be used like so:\n\n```js\nimport rxmq from 'ecc-messagebus';\n// ...\n// get channel\nconst channel = rxmq.channel('yourChannel');\n// subscribe to topic\nchannel.subject('someTopic').subscribe(({data, replySubject}) =\u003e {\n    // ...\n    // use envelop.reply to send response\n    replySubject.onNext({some: 'response'});\n    replySubject.onCompleted();\n});\n// ...\n// initiate request and handle response as a promise\nchannel.request({\n    topic: 'someTopic',\n    data: {test: 'test'},\n    timeout: 2000\n})\n.subscribe((data) =\u003e {\n    // work with data here\n    // ...\n},\n(err) =\u003e {\n    // catch and handle error here\n    // ...\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feccenca%2Fecc-messagebus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feccenca%2Fecc-messagebus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feccenca%2Fecc-messagebus/lists"}