import { Component } from './react-mvx' ; const dontAutobind = [ 'State' , 'Store' , 'constructor' , 'componentWillMount' , 'componentDidMount' , 'componentWillReceiveProps' , 'shouldComponentUpdate' , 'componentWillUpdate' , 'componentDidUpdate' , 'componentWillUnmount' , 'render' , 'getDefaultProps' , 'getChildContext' ] ; /**
 * ES5 components definition factory
 */ export default function createClass < P , S > ( { statics , ... a_spec } ) { const methods = [ ] ; const Subclass = Component . extend ( { constructor ( ) { Component . apply ( this , arguments ) ; for ( let method of methods ) { this [ method ] = this [ method ] . bind ( this ) ; } } , ... a_spec } , statics ) ; const Proto = Subclass . prototype ; for ( let key in Proto ) { if ( Proto . hasOwnProperty ( key ) && dontAutobind . indexOf ( key ) === - 1 && typeof Proto [ key ] === 'function' ) { methods . push ( key ) ; } } return Subclass ; }