Skip to content

Allow to pass custom dispatcher to Root component #33

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

Closed
wants to merge 3 commits into from

Conversation

vslinko
Copy link
Contributor

@vslinko vslinko commented Jun 4, 2015

Will be helpful for #32

@@ -12,12 +13,19 @@ export default class ReduxRoot {
};

constructor(props) {
this.dispatcher = createDispatcher();
this.dispatcher.receiveStores(props.stores);
this.dispatcher = props.dispatcher || createDispatcher();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't createDispatcher() be called in static defaultProps?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It isn't good for two reasons:

  • Dispatcher from defaultProps will be shared between all Root instances.
  • It will be created even if we don't use it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, you're right 👍

@vslinko
Copy link
Contributor Author

vslinko commented Jun 4, 2015

@gaearon what are you think?

@gaearon
Copy link
Contributor

gaearon commented Jun 4, 2015

I'm going to change quite a few things inside with #6 (work in progress) so hard to say now. I'll keep your use case from #32 in mind.

@gaearon
Copy link
Contributor

gaearon commented Jun 6, 2015

Closed via #46

@gaearon gaearon closed this Jun 6, 2015
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

Successfully merging this pull request may close these issues.

None yet

3 participants