mirror of
https://github.com/maxgoedjen/secretive.git
synced 2025-05-10 13:07:22 +00:00
23 lines
600 B
Swift
23 lines
600 B
Swift
import Foundation
|
|
import Combine
|
|
|
|
public class SecretStoreList: ObservableObject {
|
|
|
|
@Published public var stores: [AnySecretStore] = []
|
|
@Published public var modifiableStore: AnySecretStoreModifiable?
|
|
|
|
public init() {
|
|
}
|
|
|
|
public func add<SecretStoreType: SecretStore>(store: SecretStoreType) {
|
|
stores.append(AnySecretStore(store))
|
|
}
|
|
|
|
public func add<SecretStoreType: SecretStoreModifiable>(store: SecretStoreType) {
|
|
let modifiable = AnySecretStoreModifiable(modifiable: store)
|
|
modifiableStore = modifiable
|
|
stores.append(modifiable)
|
|
}
|
|
|
|
}
|