Open History to see the last commit
1import { Connection } from "@t3tools/client-runtime/connection";
2import * as Layer from "effect/Layer";
3import { Atom } from "effect/unstable/reactivity";
4
5import { runtimeContextLayer } from "../lib/runtime";
6import { connectionPlatformLayer } from "./platform";
7
8const providedConnectionPlatformLayer = connectionPlatformLayer.pipe(
9 Layer.provide(runtimeContextLayer),
10);
11
12type ConnectionLayerSource =
13 | typeof Connection.layer
14 | typeof runtimeContextLayer
15 | typeof connectionPlatformLayer;
16
17const connectionLayer = Connection.layer.pipe(
18 Layer.provideMerge(Layer.mergeAll(runtimeContextLayer, providedConnectionPlatformLayer)),
19);
20
21export const connectionAtomRuntime: Atom.AtomRuntime<
22 Layer.Success<ConnectionLayerSource>,
23 Layer.Error<ConnectionLayerSource>
24> = Atom.runtime(connectionLayer);