Effect CommunityEC
Effect Community•2y ago•
1 reply
Guillem

Effect Schema Enhances Developer Experience with `parseIssueTitle` Annotation

Effect Schema has so many things... 🤩

Reading README, and found identifier and parseIssueTitle https://github.com/Effect-TS/effect/blob/main/packages/schema/README.md#parseissuetitle-annotation

export const Entity = S.Struct({
    id: S.UUID,
    version: Version,
}).annotations({
    identifier: '@xiroi/shared-domain/Entity',
    parseIssueTitle: ({ actual }: ParseResult.ParseIssue) => {
        if (S.is(S.Struct({ id: S.String }))(actual))
            return `Entity with id ${actual.id}`
        return
    },
})
type Entity = S.Schema.Type<typeof Entity>


The Effect team and community are building an amazing DX 🥳
Was this page helpful?