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

Shared state #3

Closed
ooflorent opened this issue Jun 2, 2015 · 3 comments
Closed

Shared state #3

ooflorent opened this issue Jun 2, 2015 · 3 comments

Comments

@ooflorent
Copy link
Contributor

In many cases it is mandatory to share state between components (e.g. sessionStore). How can we achieve that using your library since stores are stateless? Could you add an example or an entry to the README?

@gaearon
Copy link
Contributor

gaearon commented Jun 2, 2015

Can you provide a more specific example? Stores don't own the state, but they still can provide the initial state and return the new versions of it in response to the dispatched actions. From the components' point of view, this doesn't differ from Flux. Components can perform actions and read shared data from the same store. (It's just that internally, it's not Store holding the data.)

@ooflorent
Copy link
Contributor Author

I spoke too quickly. I tried something odd but it still works...
Sorry for the noise.

@gaearon
Copy link
Contributor

gaearon commented Jun 2, 2015

No problem!

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

2 participants