Creating Generic Effect Wrappers in TypeScript

How would I create generic Effect wrappers?

const test(args: {
  storeState: <E, R>() => Effect.Effect<void, E, R>;
}) => {...}

test({storeState: Effect.gen(function* () { ... })


In the above, if I call test with anything where the error or requirements channel is not never, I get a 'E' could be instantiated with an arbitrary type which could be unrelated to 'SystemError | ParseError' etc.

Would be great if anyone can point me in the right direction to solve this!
Was this page helpful?