Skip to content

Instantly share code, notes, and snippets.

@tmbtech
Created July 8, 2015 03:31
Show Gist options
  • Save tmbtech/3fc73a9210cfa41a3bd2 to your computer and use it in GitHub Desktop.
Save tmbtech/3fc73a9210cfa41a3bd2 to your computer and use it in GitHub Desktop.
//saving from reactiflux channel, credit: pgwsmith.
export default function componentClassConnectedToStore(Component, store, storeIdentifier) {
const ComponentWrapper = React.createClass({
mixins: [Reflux.connect(store, storeIdentifier)],
render() {
return (
<Component {...this.props} {...this.state} />
);
}
});
return ComponentWrapper;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment