Hyperlinkv0.8.0-beta.28

Layer

Layer.emptyconsteffect/Layer.ts:856
Layer<never, never, never>

An empty layer that provides no services, cannot fail, has no requirements, and performs no construction or finalization work.

When to use

Use as the no-op branch when conditionally composing layers.

Example (Disabling optional lifecycle work)

import { Console, Layer } from "effect"

declare const flag: boolean

const StartupLogLive = flag
  ? Layer.effectDiscard(Console.log("application starting"))
  : Layer.empty
constructorseffectDiscard
Source effect/Layer.ts:8561 lines
export const empty: Layer<never> = succeedContext(Context.empty())
Referenced by 2 symbols