Package: effect
Module: ScopedCache
Sets a successful value for a key without running the lookup function.
When to use
Use to seed or overwrite a scoped cache entry with an already available successful value.
Details
This replaces and closes any existing entry scope for the key, applies the cache’s TTL using a successful exit for the value, and may evict older entries if the cache capacity is exceeded.
See
get for reading or computing a cached valuerefresh for replacing an entry by running the lookup functionSignature
declare const set: { <Key, A>(key: Key, value: A): <E, R>(self: ScopedCache<Key, A, E, R>) => Effect.Effect<void>; <Key, A, E, R>(self: ScopedCache<Key, A, E, R>, key: Key, value: A): Effect.Effect<void>; }
Since v4.0.0