{"id":24580316,"url":"https://github.com/colinskow/rx-ipc-electron","last_synced_at":"2025-07-27T02:07:14.590Z","repository":{"id":20642986,"uuid":"90503810","full_name":"colinskow/rx-ipc-electron","owner":"colinskow","description":"Pass RxJS Observables through IPC in Electron","archived":false,"fork":false,"pushed_at":"2022-12-06T19:50:15.000Z","size":77,"stargazers_count":29,"open_issues_count":15,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-24T01:09:35.037Z","etag":null,"topics":["electron","ipc","observable","rxjs"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/colinskow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-07T02:29:25.000Z","updated_at":"2023-02-08T06:28:16.000Z","dependencies_parsed_at":"2023-01-12T08:15:41.220Z","dependency_job_id":null,"html_url":"https://github.com/colinskow/rx-ipc-electron","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colinskow%2Frx-ipc-electron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colinskow%2Frx-ipc-electron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colinskow%2Frx-ipc-electron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colinskow%2Frx-ipc-electron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/colinskow","download_url":"https://codeload.github.com/colinskow/rx-ipc-electron/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250540941,"owners_count":21447427,"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":["electron","ipc","observable","rxjs"],"created_at":"2025-01-24T01:53:25.821Z","updated_at":"2025-04-24T01:09:41.252Z","avatar_url":"https://github.com/colinskow.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rx-IPC-Electron\n\n[![Build Status](https://travis-ci.org/colinskow/rx-ipc-electron.png?branch=master)](https://travis-ci.org/colinskow/rx-ipc-electron)\n\n**Easily pass RxJS Observables between the main and renderer processes of your Electron app!**\n\n## Why\n\nObservables are probably the simplest way to coordinate asynchronous events and pass data between the main and renderer processes in an Electron app.\n\nThis module makes it easy. Simply create a factory function which returns any Observable or Subject and register a listener. Then run the command from another process in your app and the returned observable will pass through.\n\n## Setup\n\n```bash\nnpm install rx-ipc-electron --save\n```\n\n#### From the Electron MAIN process\n\n```js\nimport rxIpc from 'rx-ipc-electron/lib/main';\n// const rxIpc = require('rx-ipc-electron/lib/main');\n```\n\n#### From the Electron RENDERER process\n\n```js\nimport rxIpc from 'rx-ipc-electron/lib/renderer';\n// const rxIpc = require('rx-ipc-electron/lib/renderer');\n```\n\n## Quick Start\n\n#### MAIN\n\n```js\n// This is a factory function that returns an Observable\nfunction createObservable(...args) {\n  return Observable.from(args)\n    .map(x =\u003e x * 2);\n}\nrxIpc.registerListener('create-observable', createObservable);\n```\n\n#### RENDERER\n\n```js\nconst results = [];\n// null to target the main process, otherwise a `webContents`\n// object from the window you want to target\nrxIpc.runCommand('create-observable', null, 1, 2, 3)\n  .subscribe(\n    (data) =\u003e {\n      results.push(data);\n    },\n    (err) =\u003e {\n      console.error(err);\n    },\n    () =\u003e {\n      console.log(results);\n      // Logs [2, 4, 6]\n    }\n  );\n```\n\n## API\n\n#### `rxIpc.checkRemoteListener(channel, receiver)`\n\nChecks if a listener is active on the receiver for the channel you specify.\n\n* `channel` (`string`) the name of the command you want to check.\n* `receiver` (`null` or `webContents`) null if the main process is the target, otherwise the `webContents` object of the window you want to target.\n\n**Returns:** a `Promise` that is resolved if the listner is active, otherwise rejected.\n\n#### `rxIpc.cleanUp()`\n\nRemoves all active command listeners.\n\n**Returns:** `void`\n\n#### `rxIpc.registerListener(channel, observableFactory)`\n\nRegisters a new listener for the command you specify.\n\n* `channel` (`string`) the name of the command you want to register.\n* `observableFactory` (`function`) a function which can take any number of arguments (passed through from `rxIpc.runCommand`) and returns an Observable.\n\n**Returns:** `void`.\n\n#### `rxIpc.removeListeners(channel)`\n\nRemoves all listeners for the channel you specify.\n\n* `channel` (`string`) the name of the command for the listener you want to remove.\n\n**Returns:** `void`.\n\n#### `rxIpc.runCommand(channel, receiver, ...args)`\n\nRuns the command you specify on the remote receiver.\n\n* `channel` (`string`) the name of the registered command you want to run.\n* `receiver` (`null` or `webContents`) null if the main process is the target, otherwise the `webContents` object of the window you want to target.\n* `...args` any number of arguments to be passed to the remote Observable factory function.\n\n**Returns:** an `Observable` passed through from the remote Observable.\n\n## Release History\n\n* **0.1.0** (2017-05-06) - Initial Release\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolinskow%2Frx-ipc-electron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcolinskow%2Frx-ipc-electron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolinskow%2Frx-ipc-electron/lists"}