TypeState with Invoke #1650
Unanswered
codingedgar
asked this question in
Q&A
Replies: 1 comment 3 replies
-
AFAIK typestates only affect SETTING_COOKIES: {
invoke: {
src: (_ctx) => {
const ctx = _ctx as Context2
}
} |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi! I'm using typescript (4.1.2) with XState (4.14) I'm trying to use
createMahcine
with TypeStates, but allinvoke
(promises) configurations assume theContext
is in the default version, inside theinvoke
I don't know how to do amatch
to see if the type narrowing kicks in, is there a right way to use TypeState withinvoke
?to
Context2` here, tho not sure if it gets verified, does it gets verified a context is set before transitiones?invoke
expectsContext1
, no sure how to narrowContext1
toContext2
insrc
, is any way to let the type system know the context should beContext2
here?Beta Was this translation helpful? Give feedback.
All reactions