Effect CommunityEC
Effect Communityโ€ข2mo agoโ€ข
12 replies
Jcampuza

Using Effect with TRPC in a Production App

Anybody ever used Effect with TRPC? I know effect has its own rpc, but we have a production app we're starting to add effect to using trpc and don't want to rip it out entirely yet. So far we're just having procedures return effects and passing in the context as an argument. ex:
procedure.query(opts => {
    return await Effect.runPromise(getExampleEffect(opts))
  })
where the getExampleEffect just calls Effect.gen and uses the opts inline. I'm guessing a better method of doing this would be to turn opts into a layer of some kind and yielding the tags for easier testing and such? Sort of newish.
Was this page helpful?