mirror of
https://github.com/Effect-TS/effect.git
synced 2026-12-03 03:25:40 +08:00
use layer / layerConfig convention for sql-* packages (#3852)
This commit is contained in:
@@ -254,7 +254,7 @@ export const make = (
|
||||
* @category layers
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export const layer = (
|
||||
export const layerConfig = (
|
||||
config: Config.Config.Wrap<SqliteClientConfig>
|
||||
): Layer.Layer<SqliteClient | Client.SqlClient, ConfigError> =>
|
||||
Layer.scopedContext(
|
||||
@@ -267,3 +267,17 @@ export const layer = (
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
/**
|
||||
* @category layers
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export const layer = (
|
||||
config: SqliteClientConfig
|
||||
): Layer.Layer<SqliteClient | Client.SqlClient, ConfigError> =>
|
||||
Layer.scopedContext(
|
||||
Effect.map(make(config), (client) =>
|
||||
Context.make(SqliteClient, client).pipe(
|
||||
Context.add(Client.SqlClient, client)
|
||||
))
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user