Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

DesktopState.ts

21 lines536 Bytes

1import * as Context from "effect/Context";
2import * as Effect from "effect/Effect";
3import * as Layer from "effect/Layer";
4import * as Ref from "effect/Ref";
5​
6export interface DesktopStateShape {
7 readonly backendReady: Ref.Ref<boolean>;
8 readonly quitting: Ref.Ref<boolean>;
9}
10​
11export class DesktopState extends Context.Service<DesktopState, DesktopStateShape>()(
12 "t3/desktop/State",
13) {}
14​
15export const layer = Layer.effect(
16 DesktopState,
17 Effect.all({
18 backendReady: Ref.make(false),
19 quitting: Ref.make(false),
20 }),
21);