Effect CommunityEC
Effect Community•3y ago•
5 replies
staubfuss

Flattening Nested TypeScript Effect

Hi all, I feel kinda stupid because I am stuck with a thing I thought is really easy to accomplish but apparently I am to stupid 😳 How can I flatten the following Efect
Effect.Effect<never, JsonParseError, Effect.Effect<never, ParseError, {
    readonly originator: string;
    readonly formTemplateId: string;
    readonly formSubjectId: string;
    readonly sectionIndex: readonly number[];
    readonly date: number;
}>[]>

I would like to merge the error channels and end up with
Effect.Effect<never, JsonParseError | ParseError, {...}[]
Was this page helpful?