mirror of
https://github.com/metabolist/metatext.git
synced 2024-12-23 05:56:30 +00:00
24 lines
775 B
Swift
24 lines
775 B
Swift
// Copyright © 2020 Metabolist. All rights reserved.
|
|
|
|
import Foundation
|
|
|
|
class SecondaryNavigationViewModel: ObservableObject {
|
|
@Published private(set) var identity: Identity
|
|
private let identityRepository: IdentityRepository
|
|
|
|
init(identityRepository: IdentityRepository) {
|
|
self.identityRepository = identityRepository
|
|
identity = identityRepository.identity
|
|
identityRepository.$identity.dropFirst().assign(to: &$identity)
|
|
}
|
|
}
|
|
|
|
extension SecondaryNavigationViewModel {
|
|
func identitiesViewModel() -> IdentitiesViewModel {
|
|
IdentitiesViewModel(identityRepository: identityRepository)
|
|
}
|
|
|
|
func preferencesViewModel() -> PreferencesViewModel {
|
|
PreferencesViewModel(identityRepository: identityRepository)
|
|
}
|
|
}
|