Files
Morgan Pretty 0df6501265 Pushing up my WIP changes from the last few days
Got a number of the GroupUpdate messages working properly
Updated the DisplayPictureDownloadJob to support OpenGroup room images
Updated the Poller to process messages by namespace (sorted) and added support for synchronous handling of messages
Reworked the ProfileManager to be a more reusable DisplayPictureManager
Cleaned up the conversion from milliseconds to TimeInterval (which is documented as seconds) for clarity
Fixed a read/write crash due to the SnodeAPI cache setup
Fixed an issue where dependencies could incorrectly overwrite each other when based on protocols
2023-10-19 18:02:12 +11:00

38 lines
968 B
Swift

// Copyright © 2023 Rangeproof Pty Ltd. All rights reserved.
import Foundation
// MARK: - UserDefaultsStorage
public class UserDefaultsStorage {}
// MARK: - UserDefaultsConfig
public class UserDefaultsConfig: UserDefaultsStorage {
public let identifier: String
public let createInstance: (Dependencies) -> UserDefaultsType
/// `fileprivate` to hide when accessing via `dependencies[defaults: ]`
fileprivate init(
identifier: String,
createInstance: @escaping (Dependencies) -> UserDefaultsType
) {
self.identifier = identifier
self.createInstance = createInstance
}
}
// MARK: - Creation
public extension Dependencies {
static func create(
identifier: String,
createInstance: @escaping (Dependencies) -> UserDefaultsType
) -> UserDefaultsConfig {
return UserDefaultsConfig(
identifier: identifier,
createInstance: createInstance
)
}
}