iwv

better way to invoke another window's function.

Usage no npm install needed!

<script type="module">
  import iwv from 'https://cdn.skypack.dev/iwv';
</script>

README

iwv

a electron package for Inter window invoke with full support for Linux, Mac and Windows.

npm install iwv

need electron >v14

// in main process
const { iwvMain } = require('iwv')

// swap message channle
iwvMain.swapMessageChannle(mainWindow, backendWidows)

// in render window (mainWindow)
import { iwvRenderer } from 'ivw'

(async () => {
  const result = await iwvRenderer.invoke('add', someArgument)
})

// in render window (backendWidows)
import { iwvRenderer } from 'ivw'

iwvRenderer.handle('add', async (event, someArgument) => {
  const result = await doSomeWork(someArgument)
  return result
})

Licensed under MIT license

See the MIT license file.