MCPcopy Create free account
hub / github.com/Effect-TS/effect / removeEntry

Function removeEntry

packages/effect/src/ScopedCache.ts:370–374  ·  view source on GitHub ↗
(self: ScopedCache<Key, A, E, R>, key: Key, entry: Entry<A, E>)

Source from the content-addressed store, hash-verified

368}
369
370const removeEntry = <Key, A, E, R>(self: ScopedCache<Key, A, E, R>, key: Key, entry: Entry<A, E>): void => {
371 if (self.state._tag !== "Open") return
372 const current = MutableHashMap.get(self.state.map, key)
373 if (Option.isSome(current) && current.value === entry) MutableHashMap.remove(self.state.map, key)
374}
375
376const hasExpired = <A, E>(entry: Entry<A, E>, fiber: Fiber.Fiber<unknown, unknown>): boolean => {
377 if (entry.expiresAt === undefined) {

Callers 2

ScopedCache.tsFile · 0.70
awaitEntryFunction · 0.70

Calls 2

getMethod · 0.65
removeMethod · 0.65

Tested by

no test coverage detected