effect-io-ai

Package: effect
Module: Layer

Layer.empty

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

See

Signature

declare const empty: Layer<never, never, never>

Source

Since v2.0.0