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

Add multi-component example to show how state can be shared #9

Merged
merged 1 commit into from
Jul 26, 2021
Merged

Add multi-component example to show how state can be shared #9

merged 1 commit into from
Jul 26, 2021

Conversation

Firstyear
Copy link
Contributor

This adds a multi component example to demonstrate how state can be shared between components that may want to receive updates. I'm sure there could be better approaches and improvements to this, so I'd like to hear that feedback!

note: I wasn't able to use let onclick = self.dispatch.reduce_callback(|s| s.count += 1); because it wasn't work in latest chrome/edge, but it appears this also fails to trigger a callback right now in all examples of the project, so maybe there is currently a bug there?

@intendednull
Copy link
Owner

intendednull commented Jul 24, 2021

Looks great! Thanks for your interest. There was in fact a bug, all fixed now.

It might be helpful if we used DispatchProps for one of the components, so both methods are seen.

@Firstyear
Copy link
Contributor Author

Hmmm that's a good idea but I'm still hazy on how dispatch props works tbh. I'm not confident I could actually do this successfully ^^;

@intendednull intendednull merged commit f2c970a into intendednull:master Jul 26, 2021
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.

2 participants