All Projects → colinskow → rx-ipc-electron

colinskow / rx-ipc-electron

Licence: MIT License
Pass RxJS Observables through IPC in Electron

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to rx-ipc-electron

ng-observe
Angular reactivity streamlined...
Stars: ✭ 65 (+132.14%)
Mutual labels:  rxjs, observable
rxjs-proxify
Turns a Stream of Objects into an Object of Streams
Stars: ✭ 34 (+21.43%)
Mutual labels:  rxjs, observable
rxrest
Reactive rest library
Stars: ✭ 33 (+17.86%)
Mutual labels:  rxjs, observable
Jupyterlab Data Explorer
First class datasets in JupyterLab
Stars: ✭ 146 (+421.43%)
Mutual labels:  rxjs, observable
rx-ease
Spring animation operator for rxjs 🦚✨
Stars: ✭ 16 (-42.86%)
Mutual labels:  rxjs, observable
Rx Sandbox
Marble diagram DSL based test suite for RxJS 6
Stars: ✭ 151 (+439.29%)
Mutual labels:  rxjs, observable
rxact
Rxact is an observable application management for Javascript app
Stars: ✭ 21 (-25%)
Mutual labels:  rxjs, observable
Rxjs Hooks
React hooks for RxJS
Stars: ✭ 1,953 (+6875%)
Mutual labels:  rxjs, observable
BittrexRx
BittrexRx is a rxjs node wrapper for the Bittrex Api
Stars: ✭ 16 (-42.86%)
Mutual labels:  rxjs, observable
observe-component
A library for accessing React component events as reactive observables
Stars: ✭ 36 (+28.57%)
Mutual labels:  rxjs, observable
Awesome Rxjs
Awesome list of RxJS 5
Stars: ✭ 141 (+403.57%)
Mutual labels:  rxjs, observable
react-with-observable
Use Observables with React declaratively!
Stars: ✭ 108 (+285.71%)
Mutual labels:  rxjs, observable
Marble
Marble.js - functional reactive Node.js framework for building server-side applications, based on TypeScript and RxJS.
Stars: ✭ 1,947 (+6853.57%)
Mutual labels:  rxjs, observable
observable-profiler
Tracks new & disposed Observable subscriptions
Stars: ✭ 41 (+46.43%)
Mutual labels:  rxjs, observable
Redux Most
Most.js based middleware for Redux. Handle async actions with monadic streams & reactive programming.
Stars: ✭ 137 (+389.29%)
Mutual labels:  rxjs, observable
mst-effect
💫 Designed to be used with MobX-State-Tree to create asynchronous actions using RxJS.
Stars: ✭ 19 (-32.14%)
Mutual labels:  rxjs, observable
React Eva
Effects+View+Actions(React distributed state management solution with rxjs.)
Stars: ✭ 121 (+332.14%)
Mutual labels:  rxjs, observable
Od Virtualscroll
🚀 Observable-based virtual scroll implementation in Angular
Stars: ✭ 133 (+375%)
Mutual labels:  rxjs, observable
monogram
Aspect-oriented layer on top of the MongoDB Node.js driver
Stars: ✭ 76 (+171.43%)
Mutual labels:  rxjs, observable
rjax
base on rxjs awesome ajax library
Stars: ✭ 63 (+125%)
Mutual labels:  rxjs, observable

Rx-IPC-Electron

Build Status

Easily pass RxJS Observables between the main and renderer processes of your Electron app!

Why

Observables are probably the simplest way to coordinate asynchronous events and pass data between the main and renderer processes in an Electron app.

This 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.

Setup

npm install rx-ipc-electron --save

From the Electron MAIN process

import rxIpc from 'rx-ipc-electron/lib/main';
// const rxIpc = require('rx-ipc-electron/lib/main');

From the Electron RENDERER process

import rxIpc from 'rx-ipc-electron/lib/renderer';
// const rxIpc = require('rx-ipc-electron/lib/renderer');

Quick Start

MAIN

// This is a factory function that returns an Observable
function createObservable(...args) {
  return Observable.from(args)
    .map(x => x * 2);
}
rxIpc.registerListener('create-observable', createObservable);

RENDERER

const results = [];
// null to target the main process, otherwise a `webContents`
// object from the window you want to target
rxIpc.runCommand('create-observable', null, 1, 2, 3)
  .subscribe(
    (data) => {
      results.push(data);
    },
    (err) => {
      console.error(err);
    },
    () => {
      console.log(results);
      // Logs [2, 4, 6]
    }
  );

API

rxIpc.checkRemoteListener(channel, receiver)

Checks if a listener is active on the receiver for the channel you specify.

  • channel (string) the name of the command you want to check.
  • receiver (null or webContents) null if the main process is the target, otherwise the webContents object of the window you want to target.

Returns: a Promise that is resolved if the listner is active, otherwise rejected.

rxIpc.cleanUp()

Removes all active command listeners.

Returns: void

rxIpc.registerListener(channel, observableFactory)

Registers a new listener for the command you specify.

  • channel (string) the name of the command you want to register.
  • observableFactory (function) a function which can take any number of arguments (passed through from rxIpc.runCommand) and returns an Observable.

Returns: void.

rxIpc.removeListeners(channel)

Removes all listeners for the channel you specify.

  • channel (string) the name of the command for the listener you want to remove.

Returns: void.

rxIpc.runCommand(channel, receiver, ...args)

Runs the command you specify on the remote receiver.

  • channel (string) the name of the registered command you want to run.
  • receiver (null or webContents) null if the main process is the target, otherwise the webContents object of the window you want to target.
  • ...args any number of arguments to be passed to the remote Observable factory function.

Returns: an Observable passed through from the remote Observable.

Release History

  • 0.1.0 (2017-05-06) - Initial Release
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].