Closed mwarger closed 3 years ago
I've run into this as well. Including other ones such as services and activities.
I think the logic here should be: if any of the actions are required, the 'actions' object should be required. Same for services/activities/guards.
Then, if no activities/actions/guards/services are required, the second parameter of useMachine is not required.
There is also some work here to be done with machine.withConfig
- currently withConfig
is not typed at all.
Broke the second part of my comment off into #32
I pulled down the project and started looking at this yesterday evening.
The actions object is currently required as part of the options object in the generated
useMachine
hook, so I have to pass an empty object to quell the type-checking. This should be optional.