Instead of proceeding to :submitting after the second transition (because we fixed the validation errors), we instead end up back in [:ready :error]. The problem is in the :exit action on the [:ready :error] state. assign takes the result of the and merges it into the existing state. This means that it is impossible to remove a key from the context.
There's an easy workaround, which is to add nil as a value for that key, but I think it would work more intuitively if the assign-ed function was instead applied to the existing context to produce the next state value.
I've got a state machine:
Instead of proceeding to
:submitting
after the second transition (because we fixed the validation errors), we instead end up back in[:ready :error]
. The problem is in the:exit
action on the[:ready :error]
state.assign
takes the result of the and merges it into the existing state. This means that it is impossible to remove a key from the context.There's an easy workaround, which is to add
nil
as a value for that key, but I think it would work more intuitively if theassign
-ed function was instead applied to the existing context to produce the next state value.