You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to have observables be able to subscribe directly to other observables so they might update their own values reactively.
Today, I can solve this imperatively. If I have a ParentStore and a ChildStore, I can inject the latter into the former. Within ParentStore, when an action method is called to update a value imperatively, I can point to my ChildStore reference and imperatively call an action on it in order to effect some changed value on it.
The downside to doing it this way is that my DI registration winds up having to be far too knowledgeable about what stores are intending to be subscribed to what as I fill the constructor of each store with injected instances of each other dependent store. Further, it's suddenly not reactive so much as imperative, leaving the only reactive component being the state rendered in Blazor.
What am I missing that would allow observables to subscribe to values on other observables and in turn be able to change their own values? Thank you!
The text was updated successfully, but these errors were encountered:
@WhitWaldo I'm not sure I'm following you without a small sample, but the most obvious way would be to build a tree from your observable state and attach everything to the same shared state. There is no concept of a store in Cortex.Net, there is just observable state, with reactions tied to them.
I'd like to have observables be able to subscribe directly to other observables so they might update their own values reactively.
Today, I can solve this imperatively. If I have a ParentStore and a ChildStore, I can inject the latter into the former. Within ParentStore, when an action method is called to update a value imperatively, I can point to my ChildStore reference and imperatively call an action on it in order to effect some changed value on it.
The downside to doing it this way is that my DI registration winds up having to be far too knowledgeable about what stores are intending to be subscribed to what as I fill the constructor of each store with injected instances of each other dependent store. Further, it's suddenly not reactive so much as imperative, leaving the only reactive component being the state rendered in Blazor.
What am I missing that would allow observables to subscribe to values on other observables and in turn be able to change their own values? Thank you!
The text was updated successfully, but these errors were encountered: