import SwiftUI

@Observable class ApplicationData {
   var showValue: String = ""
   @ObservationIgnored var myObject = MyObject()
   @ObservationIgnored var myObserver: NSKeyValueObservation?

   static let shared: ApplicationData = ApplicationData()
   private init() {
      myObserver = myObject.observe(\.testValue, options: [.new], changeHandler: { obj, value in
         if let newValue = value.newValue {
            Task { @MainActor in
               self.showValue = "Value: \(newValue)"
            }
         }
      })
   }
}