effect-io-ai

Package: effect
Module: ScopedCache

ScopedCache.invalidate

Removes the entry associated with a key and closes its entry scope.

When to use

Use to remove a single key from a scoped cache and release any resources owned by that entry before a later lookup computes it again.

Details

If the key is absent, this is a no-op.

Gotchas

If the cache is closed, the effect is interrupted.

See

Signature

declare const invalidate: { <Key, A>(key: Key): <E, R>(self: ScopedCache<Key, A, E, R>) => Effect.Effect<void>; <Key, A, E, R>(self: ScopedCache<Key, A, E, R>, key: Key): Effect.Effect<void>; }

Source

Since v4.0.0