Replies: 1 comment
-
@watt |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
Given a simple feature like this:
One might expect to be able to write a view that iterates each counter like so:
But I was surprised to see that this compiles, runs without warnings, and doesn't work.
There are at least 2 ways to correct it:
@ObservableState
macroscope()
method to derive a child store collection instead of iterating the array directlyIs this broken? Or is this expected behavior, and what I've constructed here is considered a misuse? I couldn't find any documentation on a case quite like this.
Checklist
main
branch of this package.Expected behavior
I would hope for one of these:
scope()
instead.Actual behavior
Clicking the increment and decrement buttons doesn't update the view.
Reproducing project
This is the CaseStudies project from TCA with the
01-GettingStarted-Bindings-Forms
sample replaced by the code above. And a few tweaks to make it build under iOS 16.CaseStudies.zip
The Composable Architecture version information
main
Destination operating system
tested on iOS 16.4 and iOS 18.0
Xcode version information
Version 16.1 (16B40)
Swift Compiler version information
Beta Was this translation helpful? Give feedback.
All reactions