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

ProviderHostPathWatcher.ts

18 lines735 Bytes

1import * as Effect from "effect/Effect";
2import * as Layer from "effect/Layer";
3import * as Stream from "effect/Stream";
4​
5import * as DesktopTelemetryReceiver from "../resourceTelemetry/DesktopTelemetryReceiver.ts";
6import * as ProviderRegistry from "./ProviderRegistry.ts";
7​
8/** The desktop's shell PATH can arrive after drivers were built and checked against a bare one. */
9export const layer = Layer.effectDiscard(
10 Effect.gen(function* () {
11 const receiver = yield* DesktopTelemetryReceiver.DesktopTelemetryReceiver;
12 const providers = yield* ProviderRegistry.ProviderRegistry;
13 yield* receiver.pathChanges.pipe(
14 Stream.runForEach(() => providers.rebuildMissingAndRefresh),
15 Effect.forkScoped,
16 );
17 }),
18);