observ-view-size
v1.0.0
Published
Observable representation of the viewport size
Downloads
2
Readme
observ-view-size
Observable representation of the viewport size
Install
$ npm install --save observ-view-size
Usage
var viewport = require('observ-view-size')
viewport()
//=> {x: width, y: height}
viewport(onResize)
//=> onResize({x, y})
API
viewport([callback])
-> function
/ object
callback
Required
Type: callback
A callback to call with {x, y}
sizes every time the window is resized. If no callback is provided, the current view size is returned.
License
MIT © Ben Drucker