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

wakeups.ts

17 lines629 Bytes

1import * as Context from "effect/Context";
2import * as Layer from "effect/Layer";
3import type * as Stream from "effect/Stream";
4​
5export type ConnectionWakeup = "application-active" | "credentials-changed";
6​
7export class ConnectionWakeups extends Context.Service<
8 ConnectionWakeups,
9 {
10 readonly changes: Stream.Stream<ConnectionWakeup>;
11 }
12>()("@t3tools/client-runtime/connection/wakeups/ConnectionWakeups") {}
13​
14export const make = (service: ConnectionWakeups["Service"]) => ConnectionWakeups.of(service);
15​
16export const layer = (service: ConnectionWakeups["Service"]) =>
17 Layer.succeed(ConnectionWakeups, make(service));