metatext/Shared/View Models/PreferencesViewModel.swift
2020-08-06 18:41:59 -07:00

16 lines
451 B
Swift

// Copyright © 2020 Metabolist. All rights reserved.
import Foundation
class PreferencesViewModel: ObservableObject {
@Published var preferences: Identity.Preferences
private let environment: IdentifiedEnvironment
init(environment: IdentifiedEnvironment) {
self.environment = environment
preferences = environment.identity.preferences
environment.$identity.map(\.preferences).assign(to: &$preferences)
}
}