Replies: 1 comment
-
Do the sub-reducers require the the shared state? If only the views require access to the state you can inject properties (Binding for read/write) or callbacks. If the reducers do require the shared state and are read-only I might be tempted to keep their state separate per domain but then include a parent reducer and If the reducer requires both read and write you can pass the shared state as an Not sure if these are ideal solutions either but I think picking the solution with the least possible intrusion is a good goal. I haven't taken the computed property route but have seen others tend to, seems like it could be tricky to up-keep with added properties and such. |
Beta Was this translation helpful? Give feedback.
-
I separate out my app state into nested sub stores. Let's say there's a chat feature, a video feature, and a login feature. What would be a good way to access
loginState.currentlyLoggedInUser
inside the chat state?My solution doesn't feel good. I'm storing
currentlyLoggedInUser
in the root state, and I create all my sub-states as computed properties.currentlyLoggedInUser
what would be a better way to do this?
Beta Was this translation helpful? Give feedback.
All reactions