| 245 | * @since 4.0.0 |
| 246 | */ |
| 247 | export const layerConfig = ( |
| 248 | config: Config.Wrap<SqliteClientConfig> |
| 249 | ): Layer.Layer<SqliteClient | Client.SqlClient, Config.ConfigError> => |
| 250 | Layer.effectContext( |
| 251 | Config.unwrap(config).pipe( |
| 252 | Effect.flatMap(make), |
| 253 | Effect.map((client) => |
| 254 | Context.make(SqliteClient, client).pipe( |
| 255 | Context.add(Client.SqlClient, client) |
| 256 | ) |
| 257 | ) |
| 258 | ) |
| 259 | ).pipe(Layer.provide(Reactivity.layer)) |
| 260 | |
| 261 | /** |
| 262 | * Builds a layer from a React Native SQLite client configuration, providing both `SqliteClient` and the generic `SqlClient` service. |