Converting from @StateObject to .task
To upgrade old Combine code in an ObservableObject that had its lifetime tied to a SwiftUI View using @StateObject we can replace it with .task and since async/await gives us a lifetime like a reference type we can do away Read more…