Class
Cache
public class Cache<Key: Hashable & Identifiable, Value>
A mutable collection used to store key-value pairs that are subject to eviction when resources are low.
Initializers
init(shouldAutomaticallyRemoveStaleItems:)
public init(shouldAutomaticallyRemoveStaleItems autoRemoveStaleItems: Bool = false)
Creates a new Cache
Parameters
| Name | Type | Description |
|---|---|---|
| autoRemoveStaleItems | Bool |
Whether to automatically remove stale items, |