electron/atom/browser/api/lib/screen.coffee

12 lines
358 B
CoffeeScript
Raw Normal View History

2015-01-14 23:11:18 +00:00
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...)