Injecting a service into your RPC route in the Effect Typescript library involves ensuring that t...

I have this RPC router:

export const appRouter = RpcRouter.make(
    Rpc.effect(
        PageGetById, (params) => Effect.gen(function* () {
            const { getPublicById } = yield* PagesContext;

            ...
        })
    )
);


The reply complaints that my service is not provided/injected: [{"_tag":"Failure","cause":{"_tag":"Die","defect":{"name":"TypeError","message":"getPublicById is not a function"}}}]

How do I provide it to the route?
Was this page helpful?