// Generated by CoffeeScript 1.9.2
var resizeListener;

resizeListener = require('./resizeListener');

module.exports = {
  getInitialState: function() {
    if (this.props.initialPageWidth) {
      return {
        pageWidth: this.props.initialPageWidth
      };
    } else {
      return {};
    }
  },
  componentDidMount: function() {
    return resizeListener.on(this.onResize);
  },
  componentWillUnmount: function() {
    return resizeListener.off(this.onResize);
  },
  onResize: function(pageWidth) {
    return this.setState({
      pageWidth: pageWidth
    });
  }
};
