(
build: (
memoMap: MemoMap,
scope: Scope.Scope
) => Effect<Context.Context<ROut>, E, RIn>
)
| 358 | * @since 4.0.0 |
| 359 | */ |
| 360 | export const fromBuild = <ROut, E, RIn>( |
| 361 | build: ( |
| 362 | memoMap: MemoMap, |
| 363 | scope: Scope.Scope |
| 364 | ) => Effect<Context.Context<ROut>, E, RIn> |
| 365 | ): Layer<ROut, E, RIn> => |
| 366 | fromBuildUnsafe((memoMap: MemoMap, scope: Scope.Scope) => { |
| 367 | const layerScope = Scope.forkUnsafe(scope) |
| 368 | return internalEffect.onExit( |
| 369 | build(memoMap, layerScope), |
| 370 | (exit) => exit._tag === "Failure" ? Scope.close(layerScope, exit) : internalEffect.void |
| 371 | ) |
| 372 | }) |
| 373 | |
| 374 | /** |
| 375 | * Constructs a `Layer` from a function that uses a `MemoMap` and `Scope` to |
no test coverage detected