State<K, A, E>Represents whether a ScopedCache is open or closed.
When to use
Use when inspecting the low-level lifecycle state of a scoped cache.
Details
Open stores cached entries in access order for reuse and eviction.
Closed means the owning scope has closed and the cache can no longer
perform lookup operations.
export type type State<K, A, E> =
| {
readonly _tag: "Open"
readonly map: MutableHashMap.MutableHashMap<
K,
Entry<A, E>
>
}
| {
readonly _tag: "Closed"
}
Represents whether a ScopedCache is open or closed.
When to use
Use when inspecting the low-level lifecycle state of a scoped cache.
Details
Open stores cached entries in access order for reuse and eviction.
Closed means the owning scope has closed and the cache can no longer
perform lookup operations.
State<function (type parameter) K in type State<K, A, E>K, function (type parameter) A in type State<K, A, E>A, function (type parameter) E in type State<K, A, E>E> = {
readonly _tag: "Open"_tag: "Open"
readonly map: MutableHashMap.MutableHashMap<
K,
Entry<A, E>
>
(property) map: {
backing: Map<K, V>;
buckets: Map<number, NonEmptyArray<K>>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
map: import MutableHashMapMutableHashMap.type MutableHashMap.MutableHashMap = /*unresolved*/ anyMutableHashMap<function (type parameter) K in type State<K, A, E>K, interface Entry<A, E>A single scoped cache entry.
When to use
Use when inspecting the open state of a ScopedCache and you need the stored
deferred result, entry scope, or expiration timestamp for a key.
Details
The entry contains the deferred lookup result shared by readers, the scope
that owns resources acquired while computing the value, and an optional
expiration time in milliseconds. Removing the entry closes its scope.
Entry<function (type parameter) A in type State<K, A, E>A, function (type parameter) E in type State<K, A, E>E>>
} | {
readonly _tag: "Closed"_tag: "Closed"
}