Using RTK with application that has many small SPAs #3595
Unanswered
domschab23
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
my team at work has a Ruby on Rails application that is set up with React components that are bundled with shakapacker. This effectively means that our whole app is compromised out of many small SPAs (single page application) that are separated from one another. We currently use RTK and RTK Query with good success. We noticed that because we use recommended pattern of having one single Redux store all reducers are included everywhere in the app. Because of our setup of us essentially having many small SPAs, most SPAs don't need particular RTK slices that are only relevant to specific SPA. Should we be worried about this? Are there any potential problems with this approach?
We pondered on splitting our store into many domain specific stores so that each store only has relevant custom slices plus apiSlice for RTK Q, but for now we agreed that this may become unmaintainable and could cause some obscure issues like having multiple stores defined on one SPA which is not as easily caught before deployment with any sort of tests. Would appreciate your thoughts here!
Beta Was this translation helpful? Give feedback.
All reactions