Effect CommunityEC
Effect Community3y ago
7 replies
Alex Dixon

Creating Interoperable Effect Code in TypeScript

I'm caught on something that seems hopelessly basic. I'm trying to have Effect code that can interop with non-Effect code. I have functions like:
const myFunction = (args: any) =>
  Effect.flatMap(SomeDependency,(dep) => dep.method(args))

I'm not sure how best to "construct" the function so R is eliminated and I have something like:
type MyFunction = (args: any) => Promise<'whatever'>


R in this case would be app-level, myFunction would be called multiple times.
Was this page helpful?