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

Where are the states ? #18

Closed
rottmann opened this issue Sep 4, 2014 · 7 comments
Closed

Where are the states ? #18

rottmann opened this issue Sep 4, 2014 · 7 comments

Comments

@rottmann
Copy link

rottmann commented Sep 4, 2014

In your example jsfiddle you access the stores directly {this.stores.increment.store.total}
Why not transfer the data automatically from the stores to the local state ?

The benefit will be, that it is unimportant for the view renderer from where the state data come (decoupled).

@f
Copy link
Owner

f commented Sep 4, 2014

You mean the React's state?

@rottmann
Copy link
Author

rottmann commented Sep 4, 2014

Yes, or did i misunderstood the usage?

@rottmann
Copy link
Author

rottmann commented Sep 4, 2014

I test fluxxor some days ago, they implement a function for the transfer to the local state.
Example http://fluxxor.com/guides/async-data.html getStateFromFlux: function() {

@f
Copy link
Owner

f commented Sep 5, 2014

But stores don't know which views is listening theirselves. If they do, it wouldn't be unidirectional, it becomes bidirectional. Am I right?

@f
Copy link
Owner

f commented Sep 5, 2014

Actually it makes sense when I read the Fluxxor's code. I'll try to implement it.

@f
Copy link
Owner

f commented Sep 5, 2014

Ahh, hey now I read the code again and saw that I already pass the store data to the local state, it means DeLorean already supports what Fluxxor does, but automatically.

And you can use

{this.state.stores.increment.total}

Here is the example: http://jsfiddle.net/a2ms7rcc/2/

@rottmann
Copy link
Author

rottmann commented Sep 5, 2014

Thanks, will have a closer look on it.

@rottmann rottmann closed this as completed Sep 5, 2014
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