-
Notifications
You must be signed in to change notification settings - Fork 256
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
Provide an event subscription system for external API consumption #2084
Comments
Do you consider "external subscription" a different thing from plugins that intercept actions via reducers? |
I think so, but I don't think I know exactly how plugins should intercept actions via reducers. In the current plugin system, plugins only receive the updates for props that are passed into the parent into which they inject themselves, not the whole state. However, they can read the state whenever they like, and can inject their own reducers. There is an example of this in the integration tests, though I don't think it's very fleshed out. How do you imagine the reducer interception working? The plugin system has a lot of room for improvement. Could we create another integration test with a plugin that would require this type of interception? |
Would you agree with that classifications? Are there more? |
These are the main APIs, but there is more to the details. The reasons for providing these different types of APIs has to do with the community of users. I've provided some context for this here: #1693. It seems we're touching on these questions more and more this week, which is good. Not sure which of these concerns needs to be tackled first in order to lead to the best outcome. |
There are many, many ways of accomplishing this. The use cases are described in a general way in #1693, and we know of a list of required events in #1865.
One proposal is given in @charbugs ' wiki page, but I want to discuss this more (in the present ticket).
In particular, I would prefer that much of the external subscription facility be provided by some automated means or middleware. Investigating the react/redux community sentiment toward this, I've run across this list of libraries and approaches. Looking through them, I found the first one listed (redux-watch) to be the closest to how I imagined it working.
Redux docs on this topic: https://redux.js.org/faq/store-setup#how-do-i-subscribe-to-only-a-portion-of-the-state-can-i-get-the-dispatched-action-as-part-of-the-subscription
There is still an open question in my mind though about how to broadcast events that don't come from or create state changes, or that happen not to correspond with actions.
The text was updated successfully, but these errors were encountered: