electron-ipc-router
v1.0.5
Published
promisify electron ipc-router
Downloads
4
Readme
Promisify Electron IpcRouter
Installation
npm install electron-ipc-router
or
yarn add electron-ipc-router
Use
Main
const IpcRouter = require("electron-ipc-router")
const {ipcMain} = require("electron")
const router=new IpcRouter({
ipc:ipcMain,
})
router.on("ready",name=>{
console.log(`${name} is ready.`)
})
Renderer
const IpcRouter = require("electron-ipc-router")
const {ipcRenderer} = require("electron")
const router=new IpcRouter({
ipc:ipcRenderer,
})
await router.emit("ready","IpcRouter")