#Context precedence by initializing a machine
1 messages · Page 1 of 1 (latest)
i'm pretty sure the machine service is instantiated with the given context first (like instantiating a class and passing in values via the constructor), and then it executes any transitions
As a side note, I was also considering short-circuiting the machine using something like "complete" in the context, but then it feels the "complete" state is stored in both, the context.completed and as a state in the machine. Then I opted instead to have a COMPLETED transition going from idle to complete state and call COMPLETED on the service once it's instantiated instead. Then there is no need to store a context.completed flag in the machine.
Not sure what's the best practice though :p