electron/atom/renderer/api/lib/ipc-renderer.coffee

19 lines
479 B
CoffeeScript
Raw Normal View History

2015-12-08 02:07:47 +00:00
{EventEmitter} = require 'events'
2015-11-10 07:12:07 +00:00
binding = process.atomBinding 'ipc'
v8Util = process.atomBinding 'v8_util'
2016-01-12 02:03:02 +00:00
### Created by init.coffee. ###
2015-11-10 07:12:07 +00:00
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