Skip to content

Instantly share code, notes, and snippets.

@dispix
Created Sep 28, 2016
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