napi-rs/examples/napi/electron-renderer/index.js

8 lines
202 B
JavaScript
Raw Permalink Normal View History

const { ipcRenderer } = require('electron')
const { callLongThreadsafeFunction } = require('../index.cjs')
callLongThreadsafeFunction(() => {})
ipcRenderer.on('ping', () => ipcRenderer.send('pong'))