Skip to content

Instantly share code, notes, and snippets.

@dispix
Created September 28, 2016 14:10
Show Gist options
  • Save dispix/0990dda8537d9a1a426c97b489cd5f5c to your computer and use it in GitHub Desktop.
Save dispix/0990dda8537d9a1a426c97b489cd5f5c to your computer and use it in GitHub Desktop.
* 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