Make "screen" module a browser module
This commit is contained in:
parent
551c39e241
commit
809c995c0b
5 changed files with 15 additions and 18 deletions
11
atom/browser/api/lib/screen.coffee
Normal file
11
atom/browser/api/lib/screen.coffee
Normal file
|
@ -0,0 +1,11 @@
|
|||
binding = process.atomBinding 'screen'
|
||||
|
||||
checkAppIsReady = ->
|
||||
unless process.type is 'renderer' or require('app').isReady()
|
||||
throw new Error('Can not use screen module before the "ready" event of app module gets emitted')
|
||||
|
||||
for name, _ of binding
|
||||
do (name) ->
|
||||
module.exports[name] = (args...) ->
|
||||
checkAppIsReady()
|
||||
binding[name](args...)
|
Loading…
Add table
Add a link
Reference in a new issue