MCPcopy
hub / github.com/Effect-TS/effect / invalidate

Function invalidate

packages/effect/src/internal/rcRef.ts:180–192  ·  view source on GitHub ↗
(
  self_: RcRef.RcRef<A, E>
)

Source from the content-addressed store, hash-verified

178
179/** @internal */
180export const invalidate = <A, E>(
181 self_: RcRef.RcRef<A, E>
182): Effect<void> => {
183 const self = self_ as RcRefImpl<A, E>
184 return core.uninterruptible(core.suspend(() => {
185 if (self.state._tag !== "Acquired") {
186 return core.void
187 }
188 const state = self.state
189 self.state = stateEmpty
190 return state.scope.close(core.exitVoid)
191 }))
192}

Callers

nothing calls this directly

Calls 1

closeMethod · 0.65

Tested by

no test coverage detected