(
build: (
memoMap: MemoMap,
scope: Scope.Scope
) => Effect<Context.Context<ROut>, E, RIn>
)
| 325 | * |
| 326 | * const program = Database.use((database) => database.query("SELECT 1")) |
| 327 | * Effect.runSync(Effect.provide(program, databaseLayer)) // => "result" |
| 328 | * ``` |
| 329 | * |
| 330 | * @category constructors |
| 331 | * @since 4.0.0 |
| 332 | */ |
| 333 | export const fromBuild = <ROut, E, RIn>( |
| 334 | build: ( |
| 335 | memoMap: MemoMap, |
| 336 | scope: Scope.Scope |
| 337 | ) => Effect<Context.Context<ROut>, E, RIn> |
| 338 | ): Layer<ROut, E, RIn> => |
| 339 | fromBuildUnsafe((memoMap: MemoMap, scope: Scope.Scope) => { |
| 340 | const layerScope = Scope.forkUnsafe(scope) |
| 341 | return internalEffect.onExit( |
| 342 | build(memoMap, layerScope), |
no test coverage detected
searching dependent graphs…