Skip to content

Act on actions inside a component. #318

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
mahadazad opened this issue Mar 9, 2016 · 1 comment
Closed

Act on actions inside a component. #318

mahadazad opened this issue Mar 9, 2016 · 1 comment

Comments

@mahadazad
Copy link

Hello,
I am creating an app which is based on canvas. I am using react-redux. I have some color pickers, text size components, etc. What I want to achieve is; e.g. user changes the color in the picker an action fires which updates the UI and also the canvas component can listen to it and act accordingly. I don't want to pass handlers explicitly to the canvas component, that would be messy. I am really confused how to handle this situation in a neat way.

@gaearon
Copy link
Contributor

gaearon commented Mar 21, 2016

Please see #251 and the issues linked from there. If you have a component that cares about specific actions and can’t derive the UI from the current state, your best bet is a custom middleware that emits all actions to some kind of global pubsub system. We don’t provide this but it should be possible to create with an event emitter. If you have issues with this please create a question on StackOverflow with the code that you tried, leave a link here, and I’ll try my best to reply.

@gaearon gaearon closed this as completed Mar 21, 2016
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