mattpocock / xstate-codegen

A codegen tool for 100% TS type-safety in XState
MIT License
245 stars 12 forks source link

Support for `choose` action #61

Closed Silverwolf90 closed 3 years ago

Silverwolf90 commented 3 years ago

First of all, thanks for the absolutely amazing work on this tool 🙏 imo this is a total game changer for xstate+TS and I regret not trying it out sooner 😆

I've begun applying it to my machines, and I noticed that the choose action is not supported yet. The types for guards/actions do not get extended with the strings in the choose action's cond/actions keys.

danielkcz commented 3 years ago

@Silverwolf90 Wow, I did not even know such action exists, cool 👍

Anyway, it would be helpful if you could add a simple test machine to packages/xstate-compiled/examples. It doesn't need to make much sense logically, you can adapt any existing example. Important is to showcase type declaration fail. You can run yarn x test to verify that.

Silverwolf90 commented 3 years ago

Sure, will do 👍