mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Basic usage is:
remote = require 'remote'
Window = remote.require 'window'
w = new Window { width: 800, height: 600 }
Still need to do:
* Beter support for Array type.
* Remote objects should cheat devtools.
* Support cross-process callbacks.
23 lines
312 B
CoffeeScript
23 lines
312 B
CoffeeScript
module.exports =
|
|
class ObjectsRegistry
|
|
@nextId = 0
|
|
|
|
constructor: ->
|
|
@objects = []
|
|
|
|
getNextId: ->
|
|
++ObjectsRegistry.nextId
|
|
|
|
add: (obj) ->
|
|
id = @getNextId()
|
|
@objects[id] = obj
|
|
id
|
|
|
|
remove: (id) ->
|
|
obj = @objects[id]
|
|
delete @objects[id]
|
|
obj
|
|
|
|
get: (id) ->
|
|
@objects[id]
|