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
When you use an enum type for State, views aren't updated for changes in the associated value.
A discussion has been opened #2778, but it seems like fixes are yet to come.
I'm creating this issue since I find this a major issue, but the discussion doesn't seem to give it much visibility.
I personally find this a major issue, since states, especially for declarative UIs, are much more unambiguous using sum types instead of product types.
Hi @funct7, sorry I was testing on main because I didn't think it had deviated much from 1.9.2. Turns out the PR that made the fix was actually this one #2910, and looks like that was merged just a few days after 1.9.2.
We'll get a release out soon and then it will be officially fixed.
Description
When you use an
enum
type for State, views aren't updated for changes in the associated value.A discussion has been opened #2778, but it seems like fixes are yet to come.
I'm creating this issue since I find this a major issue, but the discussion doesn't seem to give it much visibility.
I personally find this a major issue, since states, especially for declarative UIs, are much more unambiguous using sum types instead of product types.
For example:
is much better than
as it precludes the possibility of states that shouldn't exist such as
I remember this working in v1.0.0, but it has stopped working at some version along the way.
Checklist
main
branch of this package.Expected behavior
Views should change when associated values of cases change.
Actual behavior
Views aren't changing for changes in associated values, but only for case changes.
Steps to reproduce
The following code demonstrates this:
The Composable Architecture version information
1.9.2
Destination operating system
iOS 17
Xcode version information
15.0.1
Swift Compiler version information
The text was updated successfully, but these errors were encountered: