union Error?
mailok opened this issue · 3 comments
hi!, i have this code:
export const UpdateActiveColumn = action('[EmailViewer] Update active column', payload<{ display: string }>());
export const UpdateOrderColumn = action('[EmailViewer] Update order column', payload<{ display: string, order: string }>());
and I write this:
const All = union(UpdateActiveColumn, UpdateOrderColumn);
and it shows me an error:
TS2453:The type argument for type parameter 'T1' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate '{ readonly type: "[EmailViewer] Update active column"; }' is not a valid type argument because it is not a supertype of candidate '{ payload: { display: string; }; }'. Property 'type' is missing in type '{ payload: { display: string; }; }'.
What version of TypeScript are you using? The README mentions that 2.6 is required.
Sorry, in may proyect use 2.3.4
The use of mixins - and the inference thereof - in this library mean 2.6 is required.
If upgrading TypeScript is not an option, you could consider using https://github.com/pelotom/unionize or https://github.com/aikoven/typescript-fsa