Observable interface to window focus/blur state
$ npm install --save observ-focus
var focus = require('observ-focus')
focus()
//=> true/false
focus(function onFocus (focused) {
//=> true/false
})
Returns the current focus state when the callback
is omitted. If a callback is provided, an unlisten
function is returned.
Required
Type: callback
A callback called with the window
's focus state whenever it changes.
MIT © Ben Drucker