Move all sources under atom/.
This commit is contained in:
parent
26ddbbb0ee
commit
516d46444d
217 changed files with 519 additions and 519 deletions
24
atom/renderer/api/lib/ipc.coffee
Normal file
24
atom/renderer/api/lib/ipc.coffee
Normal file
|
@ -0,0 +1,24 @@
|
|||
EventEmitter = require('events').EventEmitter
|
||||
ipc = process.atomBinding('ipc')
|
||||
|
||||
class Ipc extends EventEmitter
|
||||
constructor: ->
|
||||
process.on 'ATOM_INTERNAL_MESSAGE', (args...) =>
|
||||
@emit args...
|
||||
|
||||
window.addEventListener 'unload', (event) ->
|
||||
process.removeAllListeners 'ATOM_INTERNAL_MESSAGE'
|
||||
|
||||
send: (args...) ->
|
||||
@sendChannel 'message', args...
|
||||
|
||||
sendChannel: (args...) ->
|
||||
ipc.send 'ATOM_INTERNAL_MESSAGE', [args...]
|
||||
|
||||
sendSync: (args...) ->
|
||||
@sendSync 'sync-message', args...
|
||||
|
||||
sendChannelSync: (args...) ->
|
||||
JSON.parse ipc.sendSync('ATOM_INTERNAL_MESSAGE_SYNC', [args...])
|
||||
|
||||
module.exports = new Ipc
|
Loading…
Add table
Add a link
Reference in a new issue