{"size": 790, "ext": "js", "max_stars_repo_path": "src/containers/App.js", "max_stars_repo_name": "kjirou/developers-defense", "max_stars_repo_stars_event_min_datetime": "2017-02-11T10:20:01.000Z", "max_stars_repo_stars_event_max_datetime": "2017-03-16T01:16:38.000Z", "max_issues_repo_path": "src/containers/App.js", "max_issues_repo_name": "kjirou/developers-defense", "max_issues_repo_issues_event_min_datetime": "2016-12-27T01:47:15.000Z", "max_issues_repo_issues_event_max_datetime": "2017-04-09T06:11:59.000Z", "max_forks_repo_path": "src/containers/App.js", "max_forks_repo_name": "kjirou/developers-defense", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": 23, "max_forks_count": null, "avg_line_length": 16.4583333333, "max_line_length": 83, "alphanum_fraction": 0.6316455696}
// TODO: Apply Flow

/*::
import type { Store } from 'redux';

import type { AppState } from '../types/states';
 */

const React = require('react');

const Root = require('../components/Root');
const { createRootProps } = require('./connections');


/*::
type Props = {
  store: Store,
};
 */

class App extends React.Component {
  /*::
  props: Props;
  state: Object;
   */

  constructor(props/*:Props*/) {
    super(props);

    this.state = this._createStateFromStore();

    this.props.store.subscribe(() => {
      this.setState(this._createStateFromStore());
    });
  }

  _createStateFromStore() {
    return createRootProps(this.props.store.getState(), this.props.store.dispatch);
  }

  render() {
    return React.createElement(Root, this.state);
  }
}


module.exports = App;
