Files
t3code/apps/desktop/src/app/DesktopState.ts
T

20 lines
513 B
TypeScript

import * as Context from "effect/Context";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import * as Ref from "effect/Ref";
export class DesktopState extends Context.Service<
DesktopState,
{
readonly backendReady: Ref.Ref<boolean>;
readonly quitting: Ref.Ref<boolean>;
}
>()("@t3tools/desktop/app/DesktopState") {}
const make = Effect.all({
backendReady: Ref.make(false),
quitting: Ref.make(false),
});
export const layer = Layer.effect(DesktopState, make);