| 535 | * @since 4.0.0 |
| 536 | */ |
| 537 | export const layer = ( |
| 538 | config: SqliteClientConfig |
| 539 | ): Layer.Layer<SqliteClient | Client.SqlClient, SqlError> => |
| 540 | Layer.effectContext( |
| 541 | Effect.map(make(config), (client) => |
| 542 | Context.make(SqliteClient, client).pipe( |
| 543 | Context.add(Client.SqlClient, client) |
| 544 | )) |
| 545 | ).pipe(Layer.provide(Reactivity.layer)) |
| 546 | |
| 547 | /** |
| 548 | * Builds a layer from an Effect `Config` value, providing both the worker-backed SQLite WASM `SqliteClient` service and the generic `SqlClient` service. |