Files
electron/atom/browser/api/lib/screen.coffee
2015-01-16 11:01:38 -08:00

12 lines
358 B
CoffeeScript

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...)