Closed funct7 closed 6 months ago
Hi @funct7, your code seems to run perfectly fine for me. What problem are you seeing?
For what it's worth, the fix I alluded to in that discussion was PR'd here #2786 and merged.
Are you on 1.9.2? Not sure if I'm doing something wrong here, but it's not working properly for me...
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 https://github.com/pointfreeco/swift-composable-architecture/pull/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.
Hi @funct7, this should be fixed with the latest release, 1.9.3, and so I am going to close this for now. Let us know if there are any other problems.
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