Skip to content

Commit

Permalink
Use 'project' for ZIO Config (#956)
Browse files Browse the repository at this point in the history
  • Loading branch information
drmarjanovic authored Apr 23, 2024
1 parent ddff6fb commit 2715ae5
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final case class AppConfig(redis: RedisConfig)
object AppConfig {
type Env = AppConfig with RedisConfig

private[this] final val config = ZIO.config(deriveConfig[AppConfig])
private[this] final val config = ZLayer(ZIO.config(deriveConfig[AppConfig]))

final val layer: Layer[Config.Error, Env] = ZLayer(config) ++ ZLayer(config.map(_.redis))
final val layer: Layer[Config.Error, Env] = config >+> config.project(_.redis)
}

0 comments on commit 2715ae5

Please sign in to comment.