import React from 'react';
import {autobind} from 'core-decorators';

import ModelObserver from '../models/model-observer';

export default class ObserveModel extends React.Component {
  constructor(props, context) {
    super(props, context);
    this.state = {data: null};
    this.modelObserver = new ModelObserver({fetchData: this.fetchData, didUpdate: this.didUpdate});
  }

  componentWillMount() {
    this.mounted = true;
    this.modelObserver.setActiveModel(this.props.model);
  }

  componentWillReceiveProps(nextProps) {
    this.modelObserver.setActiveModel(nextProps.model);
  }

  @autobind
  fetchData(model) {
    return this.props.fetchData(model);
  }

  @autobind
  didUpdate(model) {
    if (this.mounted) {
      const data = this.modelObserver.getActiveModelData();
      this.setState({data});
    }
  }

  render() {
    return this.props.children(this.state.data);
  }

  componentWillUnmount() {
    this.mounted = false;
    this.modelObserver.destroy();
  }
}

@@ -178,16 +178,171 @@
 onent %7B%0A
+  static propTypes = %7B%0A    model: React.PropTypes.any,%0A    fetchData: React.PropTypes.func.isRequired,%0A    children: React.PropTypes.func.isRequired,%0A  %7D%0A%0A
   constr

Add propTypes to ObserveModel