The concern here is not connect() should mark @MainActor or not. Your onChange closure never get call because MyDevice is not ObservableObject. Just mark MyDevice with @Observable: @Observable final class MyDevice
connect()
@MainActor
onChange
MyDevice
ObservableObject
@Observable
@Observable final class MyDevice