Effect CommunityEC
Effect Community16mo ago
8 replies
Titouan Créac'h

TypeScript Function for TaggedClass with Specific Field

Hello, I'd like a function that accept any TaggedClass with a particular shape, so in my code, a tagged class that has a field named "decodedResp". This is my attempt:
export function make: <Self, Tag extends string, A, B, C, Fields extends S.Struct.Type<{ decodedResp: S.Schema<A, B, C>}>, T extends S.TaggedClass<Self, Tag, Fields>>({
    schema
}: { schema: T }) { }


I'm struggling here with Fields
Was this page helpful?