Conversation
|
Typing action and especially action meta was a problem in txstate, haven't checked but I think this is going to make it much much much easier, so super cool change :P |
|
Also I assume guards will also have params? |
Yes, action objects were previously a mess; this is going to make it much better.
Yes, guards have params 👍 |
|
That's great! |
|
Wait a min looked at the code, it's not exactly what I expected xD I was expecting type ActionObject = {
type: string,
exec?: ...,
- [k: string]: unknown
+ params: Record<string, unknown>
}The fact that out of all keys only Can we have my change? I know this would be breaking but I guess yours too is somewhat breaking? So if we're breaking things let's get them right. And the index signature on action object is problem not just for txstate but for xstate types too |
Which change is this? Should we only allow inline action objects like this? {
type: string;
params: { ... };
// no extra props
} |
This PR reworks actions so that there are "dynamic actions" and base action objects. This improves type inference for built-in actions, but also requires that parameterized actions have a
paramsproperty: