cambiata
Support for discriminated union types?
Being new to SolidJS, I'm surprised to find that the type checking for discriminated union types in
signals or stores seems to be limited. See example below.
From my perspective this is very problematic.
Am I missing something? Are there any decent workarounds? Plans for support?
In the following example, the type checker complains about the the missing
state().value
field,
in spite of the state().type === 'Data'
being matched in the Switch statement:
The error output:
12 replies