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