Loadability Documentation Beta

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(should​Automatically​Remove​Stale​Items:​)

public init(shouldAutomaticallyRemoveStaleItems autoRemoveStaleItems: Bool = false)

Creates a new Cache

Parameters

auto​Remove​Stale​Items Bool

Whether to automatically remove stale items, false by default.