A Layer describes how to build a service or set of services.
// A layer that provides a Logger serviceconst LoggerLive = Layer.succeed(Logger, consoleLogger)// A layer that requires Config and provides Databaseconst DatabaseLive = Layer.fromFunction(Database, (config: Config) => createDatabase(config.connectionString)) Copy
// A layer that provides a Logger serviceconst LoggerLive = Layer.succeed(Logger, consoleLogger)// A layer that requires Config and provides Databaseconst DatabaseLive = Layer.fromFunction(Database, (config: Config) => createDatabase(config.connectionString))
Required services (dependencies)
Possible errors during construction
Services provided by this layer
Optional
Readonly
Maps the output of this layer.
Function to transform the output
Merges two independent layers.
Layer to merge with
Composes this layer with another, running them in sequence. The output of this layer becomes available to the next layer.
Layer to compose with
String representation
A Layer describes how to build a service or set of services.
Example