This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Player class | |
* @class | |
* @classdesc Construct a new player with an independent redux store | |
*/ | |
class Player { | |
/** | |
* Class constructor | |
*/ | |
constructor() { | |
/** | |
* Create the Player class | |
* @type {Object} The react class | |
*/ | |
this._class = React.createClass({ | |
render() { | |
return | |
<Provider store={this.props.store}> | |
<Wrapper /> | |
</Provider> | |
; | |
} | |
}); | |
/** | |
* Create the Player class | |
* @type {Object} The react class | |
*/ | |
this._component = React.createElement( | |
this._class, | |
{store: this._store} | |
); | |
} | |
/** | |
* Get component | |
* @return {Object} component The react Player wrapped with store and methods | |
*/ | |
getComponent() { | |
return this._component; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment