Replies: 3 comments
-
Hi @zgotsch, this does seem to be an unfortunate gotcha, specifically with observable enums and nested enums. I understand why it's happening, and we thought we even had code in place that would make this work, but now we can't find it. We're going to investigate and will get back to you. |
Beta Was this translation helpful? Give feedback.
-
I think I've found an additional issue when working with observable enums when only the associated data changes within the same enum case. I have filed #2899. |
Beta Was this translation helpful? Give feedback.
-
Fixed in #2910. |
Beta Was this translation helpful? Give feedback.
-
I just fixed a bug in my app that was caused by inconsistently applying
@ObservableState
to nested enums within my reducer'sState
(which is also markedObservableState
). This caused view for my reducer was not re-rendering in response to changes, and was tricky to track down.Here is a minimal breaking example:
The view does not re-render when the toggle button is tapped, though you can see that the state is updating (for example, by using
_printChanges
).There are two ways to fix this:
@ObservableState
fromOuterEnum
@ObservableState
toInnerEnum
Is this the expected behavior? I would expect that adding
@ObservableState
would make observation more granular, but not to allow updates to be missed. Please let me know if I have misunderstood something or if this is a bug.Beta Was this translation helpful? Give feedback.
All reactions