Closed bartenra closed 2 years ago
Note that this actually wasn't strictly related to the typegen - it's just that raise
is at the moment not working overly well (at the type-level) and its usage "deoptimized" the TS inference algorithm. With my fix this should no longer happen - however, raise
still doesn't behave totally OK and we should take a closer look at this in the future.
Description
When I use typegen, I lose the typing of
send
fromuseMachine
.Expected result
I expect
send
to have a type that allows me to use type completion on event names as well as report incorrect event names.Actual result
send({type: ''})
is not type incorrect, neither do I get type completionReproduction
https://codesandbox.io/s/typescript-playground-export-forked-om0pfw?file=/index.ts
Additional context
No response