MCPcopy Index your code
hub / github.com/Effect-TS/effect / invalidateWhen

Method invalidateWhen

packages/effect/src/internal/cache.ts:431–442  ·  view source on GitHub ↗
(key: Key, when: (value: Value) => boolean)

Source from the content-addressed store, hash-verified

429 }
430
431 invalidateWhen(key: Key, when: (value: Value) => boolean): Effect.Effect<void> {
432 return core.sync(() => {
433 const value = MutableHashMap.get(this.cacheState.map, key)
434 if (Option.isSome(value) && value.value._tag === "Complete") {
435 if (value.value.exit._tag === "Success") {
436 if (when(value.value.exit.value)) {
437 MutableHashMap.remove(this.cacheState.map, key)
438 }
439 }
440 }
441 })
442 }
443
444 get invalidateAll(): Effect.Effect<void> {
445 return core.sync(() => {

Callers

nothing calls this directly

Calls 4

whenFunction · 0.85
syncMethod · 0.80
getMethod · 0.65
removeMethod · 0.65

Tested by

no test coverage detected