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

Multiple StoreSubscribers? #1

Open
Syrou opened this issue Jan 25, 2018 · 3 comments
Open

Multiple StoreSubscribers? #1

Syrou opened this issue Jan 25, 2018 · 3 comments

Comments

@Syrou
Copy link

Syrou commented Jan 25, 2018

Since Kotlin/Java does not support multiple implementetion of the same interface more than once
with a specific type (because of type erasure) how do you propose we implement multiple stores in the same Activity?

The issue would be to keep track of several states that I would want to display in several activities.

@hdrdavies
Copy link

Yes I'm sure this is a very common use case.... Is there any way of achieving it?

@Syrou
Copy link
Author

Syrou commented Apr 4, 2018

My current feeling is that my suggestion/question is pattern breaking, and the solution is to create a ActionCreator that routes the actions you are interested in differently. You can implement a BaseAction that contains shared states like OnError, OnLoading and OnSuccess but if there is just a specific thing that you are interested at a given time, you have to implement it in the specific action setup for a state and then inherit that specific shared action

@hdrdavies
Copy link

ah I think I might have misread your question, I was wondering how to subscribe to multiple parts of the state tree within the same activity / fragment, but I have solved this. Creating multiple stores is definitely an anti-pattern in redux.

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