https://github.com/ricsam/ipc-promises
Promise interface for the ipc commands in electron.
https://github.com/ricsam/ipc-promises
Last synced: 3 months ago
JSON representation
Promise interface for the ipc commands in electron.
- Host: GitHub
- URL: https://github.com/ricsam/ipc-promises
- Owner: ricsam
- Created: 2017-04-07T02:23:17.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-07T17:14:12.000Z (over 8 years ago)
- Last Synced: 2025-03-12T22:38:04.693Z (4 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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');
});```