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

Function auto

packages/effect/src/Resource.ts:128–135  ·  view source on GitHub ↗
(
  acquire: Effect.Effect<A, E, R>,
  policy: Schedule.Schedule<Out, unknown, E2, R2>
)

Source from the content-addressed store, hash-verified

126 * @since 2.0.0
127 */
128export const auto = <A, E, R, Out, E2, R2>(
129 acquire: Effect.Effect<A, E, R>,
130 policy: Schedule.Schedule<Out, unknown, E2, R2>
131): Effect.Effect<Resource<A, E>, never, R | R2 | Scope.Scope> =>
132 Effect.tap(
133 manual(acquire),
134 (self) => Effect.forkScoped(Effect.repeat(refresh(self), policy))
135 )
136
137/**
138 * Retrieves the current value stored in this resource.

Callers

nothing calls this directly

Calls 2

manualFunction · 0.85
refreshFunction · 0.85

Tested by

no test coverage detected