-
I know
Example const isResultExist = (_: SomeContextType, event: DoneInvokeEvent<string>): boolean => event.data.length > 0;
...
{
invoke: {
...
onDone: {
target: SomeState,
cond: isResultExist
}
}
},
{
guards: {
isResultExist // Type Error
}
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
When you put things in |
Beta Was this translation helpful? Give feedback.
actions
won't be executed ifcond
returnsfalse
, so naturallycond
happens first. I'm talking about{ cond, actions }
situation.When you put things in
options.guards
they become context-less for us, we can't infer too specific types based on how and where those are used…