Using `HttpServerResponse` with tRPC and Express in Effect

So I was using trpc + express, and decided to migrate to Effect.
However, I still need to keep trpc.

I'm basically using the runtime inside the handlers in each trpc mutation/query. This works great to pass down the dependencies and keep logic in the effect world.

Now, I want to set some cookies.
Here's how I'm doing it:

   discard: privateProcedure.mutation(
                passToEffect(
                    Effect.fn("AppSumoRouter.discard")(function* ({ ctx }) {
                        // Can't use HttpServerResponse here yet.
                        ctx.res.clearCookie("appsumo_has_license", options);
                        ctx.res.clearCookie("appsumo_license_key", options);
                    })
                )
            ),


Because the handler is trpc/express, I can't really just return an HttpServerResponse.

However, note that I can create a HttpServerRequest with .fromWeb and that works great (I inject it into the runtime so the handlers can use it).

Any solutions to using HttpServerResponse here?
Was this page helpful?