Closed aoyunfeng closed 7 years ago
Hi @aoyunfeng,
Yes, you can use it like:
export default React.createClass({
contextTypes: {
lang: React.PropTypes.string
},
mixins: [
Reflux.connect(AppStore, 'appContext'),
Reflux.connect(SyncStore, 'syncStatus'),
Reflux.listenTo(AuthenticationStore, 'onAuthentication')
],
In addition to tjankowski's answer, you'd also do this in the ES6 API via:
class MyClass extends Reflux.Component
{
constructor(props)
{
super(props);
this.stores = [OneStore, AnotherStore];
}
render()
{
// ...
}
}
The states of both Reflux.Store
objects would get merged into the state of MyClass
.
code like
var Test=React.createClass({ mixins: [Reflux.connect(oneStore,"one"),Reflux.connect(twoStore,"two")],