Package: effect
Module: Layer
Constructs a layer from an effect, discarding its value and providing no services.
When to use
Use when layer construction should run an Effect for its side effects while providing no services.
Example (Running an effect during layer construction)
import { Effect, Layer } from "effect"
const initLayer = Layer.effectDiscard(
Effect.sync(() => {
console.log("Initializing application...")
})
)
See
empty for a no-op layer that performs no construction workSignature
declare const effectDiscard: <X, E, R>(effect: Effect<X, E, R>) => Layer<never, E, Exclude<R, Scope.Scope>>
Since v2.0.0