Concurrency
Create an AsyncStream from withObservationTracking() function
I needed to create an AsyncStream to monitor changes to an @Observable model class’s var and by using withCheckedContinuation and AsyncStream‘s unfolding init I came up with this: The challenge here is withObservationTracking only watches for a single change but we can wrap that in withCheckedContinuation which also is designed Read more…