Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Multiple StoreWatchMixins #106

Open
sdemjanenko opened this issue Feb 13, 2015 · 3 comments
Open

Allow Multiple StoreWatchMixins #106

sdemjanenko opened this issue Feb 13, 2015 · 3 comments

Comments

@sdemjanenko
Copy link

I would like to be able to do something like:

var TimeMixin = {
  mixins: [StoreWatchMixin("TimeStore")],
  ...
};

var List = React.createClass({
   mixins: [..., StoreWatchMixin("ArticleStore"), TimeMixin, ...],
});

Unfortunately StoreWatchMixin only allows itself to be mixed in once per component. I would have to do something like:

var List = React.createClass({
   mixins: [..., StoreWatchMixin("ArticleStore", "TimeStore"), TimeMixin, ...],
});

and not register the StoreWatchMixin in TimeMixin which seems less than ideal.

@BinaryMuse
Copy link
Owner

Good catch! This is definitely something I want to support, but an initial pass seems to indicate it may not be super straightforward because of the way React handles non-hook methods provided by multiple mixins (that is: it doesn't). I'll give this a closer look soon.

@nelix
Copy link

nelix commented Feb 18, 2015

you could hook one of the lifecycles that get merged and dynamically create handlers that could then be enumerated?

@dantman
Copy link

dantman commented Aug 6, 2015

Isn't the only non-hook method in StoreWatchMixin the private _setStateFromFlux?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants