import { ofType, unionize, UnionOf } from 'unionize';
const MyUnion = unionize({
MyVariant: ofType<string[]>(),
});
type MyUnion = UnionOf<typeof MyUnion>;
MyUnion.match({
MyVariant: strs => strs.map(x => x), // runtime error!
});
Related: #67
Workaround: specify a value:
const MyUnion = unionize({
MyVariant: ofType<string[]>(),
-});
+}, { value: 'value' });
Related: #67
Workaround: specify a
value:const MyUnion = unionize({ MyVariant: ofType<string[]>(), -}); +}, { value: 'value' });