electron/atom/renderer/api/lib/ipc-renderer.coffee
2016-01-12 16:22:34 -08:00

18 lines
479 B
CoffeeScript

{EventEmitter} = require 'events'
binding = process.atomBinding 'ipc'
v8Util = process.atomBinding 'v8_util'
### Created by init.coffee. ###
ipcRenderer = v8Util.getHiddenValue global, 'ipc'
ipcRenderer.send = (args...) ->
binding.send 'ipc-message', [args...]
ipcRenderer.sendSync = (args...) ->
JSON.parse binding.sendSync('ipc-message-sync', [args...])
ipcRenderer.sendToHost = (args...) ->
binding.send 'ipc-message-host', [args...]
module.exports = ipcRenderer