Skip to content

Instantly share code, notes, and snippets.

@dispix
Created September 28, 2016 14:10
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
* 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