Extracting Schema Tags from a Union of Tagged Structs

What is the best way to extract a schema of all possible tags from a union of tagged structs
const A = Schema.TaggedStruct('A', {})
const B = Schema.TaggedStruct('B', {})
const All = Schema.Union(A, B)
// Not allowed to pick from a Union
// const AllTags = Schema.pick(All, '_tag')

// this works
const AllTags = Schema.typeSchema(Schema.pluck(All, '_tag'))

The final piece works but it feels like going around things to achieve it, is that the ideal way of extracting shared fields from unions?
Was this page helpful?