Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ricsam/ipc-promises

Promise interface for the ipc commands in electron.
https://github.com/ricsam/ipc-promises

Last synced: 17 days ago
JSON representation

Promise interface for the ipc commands in electron.

Awesome Lists containing this project

README

        

## Promise interface for the ipc commands in electron.

#### Example
```javascript

// renderer.js
import { ipcRenderer } from 'electron';
import ipc from 'ipc-promises';

const tunnel = new ipc(ipcRenderer);

tunnel.send('getsomedata').then((resp) => {
// resp contains the data
});

// main.js
import { ipcMain } from 'electron';
import ipc from 'ipc-promises';

const tunnel = new ipc(ipcMain);

tunnel.on('getsomedata').then((id) => {
mainTunnel.respond(id, 'data not accessible by the renderer');
});

```