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

[Question]: Mixing global and local state #222

Open
hffmnn opened this issue Oct 12, 2021 · 0 comments
Open

[Question]: Mixing global and local state #222

hffmnn opened this issue Oct 12, 2021 · 0 comments

Comments

@hffmnn
Copy link

hffmnn commented Oct 12, 2021

Using the StoreConnector it looks to me like all of the view models properties must be derived from the current store data. But what if I want to have some data that should be kept local to the view. Let's say I want to e.g. show an alert once based on an exception that is part of the redux state. For this, I would have a property like showedExceptionAlert in the view model. But whenever the view model gets regenerated the value of this property would get overridden. And I don't want to go the full redux way via actions, reducer... just because of a simple, local-only property.

For sure I could keep this data in the view, but that feels a little bit wrong to have two places to look for the current state.

Another option would be to mix e.g. the bloc pattern with redux but this also seems a little bit too much for such a simple task.

So the question is: Is there something like a pattern to have local and global (redux) state in one view model?

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

1 participant