why use assign and timing of invoke #1850
Unanswered
shmdhussain
asked this question in
Q&A
Replies: 1 comment
-
You can't.
you won't be able to manipulate the context correctly for any top-level key, so this won't work as expected: function someAction(ctx) {
ctx.foo = 'newValue'
} Either way - we do not recommend direct mutations to manipulate the context value because it makes certain things impossible (like going back in history in the visualizer etc).
Yes, always after entering the state. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi David,
This week I watched the xstate course on frontendMasters.
I have few doubts.
--first one is:
Why we need to use assign when we can directly do the same thing in action function.
I heard you are explaining this , but I am unable to understand the mutable and immutable context. could you point me to some pointers or explain me
--Second One is:
When will the invoke triggered, after entering into the state?
thanks in advance,
Beta Was this translation helpful? Give feedback.
All reactions