DexcomSettingsViewModel.swift 812 B

12345678910111213141516171819202122232425262728293031323334
  1. // LoopFollow
  2. // DexcomSettingsViewModel.swift
  3. import Combine
  4. import Foundation
  5. class DexcomSettingsViewModel: ObservableObject {
  6. @Published var userName: String = Storage.shared.shareUserName.value {
  7. willSet {
  8. if newValue != userName {
  9. Storage.shared.shareUserName.value = newValue
  10. }
  11. }
  12. }
  13. @Published var password: String = Storage.shared.sharePassword.value {
  14. willSet {
  15. if newValue != password {
  16. Storage.shared.sharePassword.value = newValue
  17. }
  18. }
  19. }
  20. @Published var server: String = Storage.shared.shareServer.value {
  21. willSet {
  22. if newValue != server {
  23. Storage.shared.shareServer.value = newValue
  24. }
  25. }
  26. }
  27. init() {}
  28. }