mattpocock / xstate-codegen

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

Final states ? #74

Closed lambda0xff closed 3 years ago

lambda0xff commented 3 years ago

In a final state, is there a way to / how should I type the data property ?

    FINAL: {
      type: 'final',
      data: {
        data: (_: any, e: any) => e.data
      }
    }

I'm getting errors if I don't put the any typing for _ and e

poelstra commented 3 years ago

You seem to have an extra level of data that should not be there.

  FINAL: {
      type: 'final',
      data: (_, e) => e.data
  }