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

Function provide

packages/effect/src/internal/managedRuntime.ts:27–40  ·  view source on GitHub ↗
(
  managed: ManagedRuntimeImpl<R, ER>,
  effect: Effect.Effect<A, E, R>
)

Source from the content-addressed store, hash-verified

25export const isManagedRuntime = (u: unknown): u is M.ManagedRuntime<unknown, unknown> => hasProperty(u, circular.TypeId)
26
27function provide<R, ER, A, E>(
28 managed: ManagedRuntimeImpl<R, ER>,
29 effect: Effect.Effect<A, E, R>
30): Effect.Effect<A, E | ER> {
31 return core.flatMap(
32 managed.runtimeEffect,
33 (rt) =>
34 core.withFiberRuntime((fiber) => {
35 fiber.setFiberRefs(rt.fiberRefs)
36 fiber.currentRuntimeFlags = rt.runtimeFlags
37 return core.provideContext(effect, rt.context)
38 })
39 )
40}
41
42const ManagedRuntimeProto = {
43 ...Effectable.CommitPrototype,

Callers 8

Layer.tsFile · 0.85
runForkFunction · 0.85
runSyncExitFunction · 0.85
runSyncFunction · 0.85
runPromiseExitFunction · 0.85
runCallbackFunction · 0.85
runPromiseFunction · 0.85
layer.tsFile · 0.85

Calls 1

setFiberRefsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…