MCPcopy Create free account
hub / github.com/effect-app/libs / make

Function make

repos/effect/packages/effect/src/ScopedRef.ts:145–151  ·  view source on GitHub ↗
(evaluate: LazyArg<A>)

Source from the content-addressed store, hash-verified

143 * @since 2.0.0
144 */
145export const make = <A>(evaluate: LazyArg<A>): Effect.Effect<ScopedRef<A>, never, Scope.Scope> =>
146 Effect.suspend(() => {
147 const scope = Scope.makeUnsafe()
148 const value = evaluate()
149 const self = makeUnsafe(scope, value)
150 return Effect.as(Effect.addFinalizer((exit) => Scope.close(self.backing.backing.ref.current[0], exit)), self)
151 })
152
153/**
154 * Sets the value of this reference to a newly acquired scoped value, releasing

Callers

nothing calls this directly

Calls 4

addFinalizerMethod · 0.80
closeMethod · 0.80
evaluateFunction · 0.70
makeUnsafeFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…