Open pokey opened 1 year ago
I agree, | InitEvent
should be added "on demand" by the consumer of the type when needed. It shouldn't be hardcoded in the ActionFunction
type
I'd appreciate a PR for this one if you'd like to fix it @pokey
@davidkpiano hey David, what's the teams plan for the fsm package? i see it's already removed from the master branch, is it considered deprecated now?
I was defining a simple state machine, and noticed that the
InitEvent
seems to always be an expected event according to the type system, when in fact, from what I can tell, it only makes sense as anentry
event for the initial state.In the following code:
See the type hint
I would expect it to just be
type: "action"
.I believe this line causes the problem:
https://github.com/statelyai/xstate/blob/e87600ea450fa19b71d2051fac3c6c54fb9d486e/packages/xstate-fsm/src/types.ts#L77