I've got a problem where setting a state property from
nil to a value isn't correctly presenting an alert, when using TCA, and it's leading me to wonder if there's a problem with my work/understanding, or if there's a bug in TCA?
We're using a mixture of MVVM and TCA, for state management. As such, the ViewModel is retaining a reference to the ViewStore, with the View interacting with the ViewModel through
Bindings derived from the
ViewStore and methods to send actions.
I've created a Binding to the alert property on my
AppState, and I can see that the state changes to fill that alert property when I click the "Show Alert" button. But the alert itself isn't presented. In debugging this, I can see that if I use a Store directly, and use
WithViewStore, the alert presents correctly.
I've looked at using AlertState, but that pushes too much of the alert configuration into the State for how I'd like to use it - I'd really prefer to just use the identifiable Binding.
My example code is in the repo below. Any help would be greatly appreciated!