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

Clarification on Single Store object for an application. #490

Open
CyborgRahil opened this issue Aug 22, 2022 · 1 comment
Open

Clarification on Single Store object for an application. #490

CyborgRahil opened this issue Aug 22, 2022 · 1 comment
Labels

Comments

@CyborgRahil
Copy link

CyborgRahil commented Aug 22, 2022

As per documentation of ReSwift:

  1. Applications have a single store that stores the entire application state. Which might be lead to
    DOC URL
  2. We can divide main app state or main app reducer into multiple sub state and sub reducer to handle complex use-cases or segregate the responsibility. Like:
    Demo project URL
  3. Similar way can we use multiple store? Eg: Each feature have separate store containing feature specific middleware(Logging, Analytics), state and reducers. Without segregation of store based upon feature, for large scale application Store works as a God object.

As per Point 1 point 3 is not possible?
Need to check what are the blockers to support point 3?

@CyborgRahil CyborgRahil changed the title Clarification on Single Store object for each application. Clarification on Single Store object for an application. Aug 22, 2022
@DivineDominion
Copy link
Contributor

Since the stores don't do anything fancy beyond maintaining consistent internal state, you should be able to create multiple stores, I believe.

Did you try this already?

The ReSwift approach is to unify state management in an app-global way. Similar to how Redux generalizes and unifies Flux.js.

For very local states, you might want to check out RxFeedback and friends. There's similar approaches for Combine, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants