Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
A small router with one Effect procedure.
effect-orpc
import { Effect } from "effect"; import { eos } from "effect-orpc"; import * as z from "zod"; class Greeter extends Effect.Service<Greeter>()("Greeter", { accessors: true, sync: () => ({ greet: (name: string) => `Hello, ${name}!`, }), }) {} const procedure = eos.provide(Greeter.Default); export const router = { greet: procedure .input(z.object({ name: z.string() })) .output(z.string()) .effect(function* ({ input }) { return yield* Greeter.greet(input.name); }), }; const greet = router.greet.callable(); console.log(await greet({ name: "Ada" }));
Was this page helpful?