Update the template screen to use the new(ish) Observation framework. (#4077)

* Update the template screen to use the new(ish) Observation framework.

* Add a variant of deferFulfillment that supports observables.

* Update snapshot fulfilment to work with either a publisher or a stream.
This commit is contained in:
Doug
2025-04-30 16:49:23 +01:00
committed by GitHub
parent 0620bd45fc
commit 61a427b8e5
12 changed files with 297 additions and 25 deletions
@@ -8,7 +8,8 @@
import Combine
import Foundation
/// A common ViewModel implementation for handling of `State` and `ViewAction`s
/// A common ViewModel implementation for handling of `State` and `ViewAction`s. This original version
/// is implemented using SwiftUI's original `ObservableObject` and `@Published` pattern.
///
/// Generic type State is constrained to the BindableState protocol in that it may contain (but doesn't have to)
/// a specific portion of state that can be safely bound to.