Conditional Typing Based on Error Properties in Effect Typescript Library
I have a
ie:
I do have this working with using generic parameter on the final Error class (see image)
Im doing this because ideally i dont want 2 separate error classes ,ie
Question is:
if this is something that effect supports?
All my types and tests seem to be working but ive also been suggested NOT to use generics type args in effect classes, but im not sure if that was more for Services and Contexts?
Data.TaggedError class and i want to be able to have one of the props from the error type (cause) to be conditionally typed based on another error prop (fromRequest)ie:
I do have this working with using generic parameter on the final Error class (see image)
Im doing this because ideally i dont want 2 separate error classes ,ie
IndexCountError and IndexCountRequestError, it would just make the end API more confusing imo. However i still want to keep that dx where type of cause can be constrained inside of a conditional on isFromRequest to get better hints on the cause.nameQuestion is:
if this is something that effect supports?
All my types and tests seem to be working but ive also been suggested NOT to use generics type args in effect classes, but im not sure if that was more for Services and Contexts?

