1.0.2 • Published 8 years ago

on-window-size v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

on-window-size Build Status

Listen to the window size

Install

$ npm install --save on-window-size

Usage

var onWindowSize = require('on-window-size')

onWindowSize(function (size) {
  console.log(size) // => {x: Number, y: Number}
})

API

var unlisten = onWindowSize(listener)

Calls listener with the result of screen-size when the window size changes.

Call the returned unlisten function to stop listening.

License

MIT © Andrew Joslin