You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Null transitions defined in the top-level of a machine are not fired if current state has no null transitions.
As far as I understand, the following examples should behave identically. Both of them should transition to 'success' state when 'ADD' event is fired.
However, the first, which has a no-op null transition defined in 'first' state, works.
Second one, which does not have a null transition defined in 'first' state, stays in 'first' state because top-level null transition is not considered.
Based on the description - you are right. When it comes to selecting transitions eventless transitions behave pretty much as regular ones - look at the defined algorithm https://www.w3.org/TR/scxml/#selectEventlessTransitions . Both of your demos are the same though 😉
@davidkpiano the fix for this will be straightforward if we believe that this is not a breaking change. I would prefer to wait with the fix until I finish my ongoing refactor to avoid merge conflicts though.
Null transitions defined in the top-level of a machine are not fired if current state has no null transitions.
As far as I understand, the following examples should behave identically. Both of them should transition to 'success' state when 'ADD' event is fired.
However, the first, which has a no-op null transition defined in 'first' state, works.
Second one, which does not have a null transition defined in 'first' state, stays in 'first' state because top-level null transition is not considered.
working version: https://codesandbox.io/s/xstate-example-template-n167o
version with issue: https://codesandbox.io/s/xstate-example-template-u8v9z
The text was updated successfully, but these errors were encountered: