MCPcopy Index your code
hub / github.com/Effect-TS/effect / layer

Function layer

packages/sql-pg/src/PgClient.ts:575–583  ·  view source on GitHub ↗
(
  config: PgClientConfig
)

Source from the content-addressed store, hash-verified

573 * @since 1.0.0
574 */
575export const layer = (
576 config: PgClientConfig
577): Layer.Layer<PgClient | Client.SqlClient, SqlError> =>
578 Layer.scopedContext(
579 Effect.map(make(config), (client) =>
580 Context.make(PgClient, client).pipe(
581 Context.add(Client.SqlClient, client)
582 ))
583 ).pipe(Layer.provide(Reactivity.layer))
584
585/**
586 * @category layers

Callers

nothing calls this directly

Calls 6

makeFunction · 0.70
pipeMethod · 0.65
mapMethod · 0.65
makeMethod · 0.65
addMethod · 0.65
provideMethod · 0.65

Tested by

no test coverage detected