platform.ts
This file
Path
apps/web/test/platform.ts
13 lines · 506 bytes · TypeScript
Last changed by
Merge build/comments-web-rest into mainoscabrielbefore adoption0eb1248
History of this fileTake it
1234567891011121314import { Client, Contracts } from "@repo/protocol/contracts";import { asTester, unanswered } from "@repo/protocol/testing";import { Layer } from "effect";import { RpcTest } from "effect/rpc";
export const platformWith = ( ...handlers: readonly Layer.Layer<never>[]): Layer.Layer<Client> => Layer.effect(Client, RpcTest.makeClient(Contracts)).pipe( Layer.provide([Layer.mergeAll(unanswered, ...handlers), asTester]) );
export const unreachablePlatform: Layer.Layer<Client> = platformWith();