Cache
Cache copied to clipboard
memoryConfig not optional for Storage.init as comment says.
trafficstars
///
/// - Parameters:
/// - diskConfig: Configuration for disk storage
/// - memoryConfig: *Optional*. Pass config if you want memory cache
/// - Throws: Throw StorageError if any.
public convenience init(diskConfig: DiskConfig, memoryConfig: MemoryConfig, transformer: Transformer<Value>) throws {
let disk = try DiskStorage<Key, Value>(config: diskConfig, transformer: transformer)
let memory = MemoryStorage<Key, Value>(config: memoryConfig)
let hybridStorage = HybridStorage(memoryStorage: memory, diskStorage: disk)
self.init(hybridStorage: hybridStorage)
}
This says memoryConfig should be Optional, but it's not. Not sure which is the typo.
The code should be the source of truth.