xstate-viz
xstate-viz copied to clipboard
Delay animation does not restart
Following up from the earlier issue there still seems to be a minor bug in the visualizer.
Observed Behavior
Right now, using the same machine as before the delay animation runs for 3000ms then sits at 100% if ACTIVITY-Events have been fired during the delay.
Expected Behavior
The animation should restart as the state is re-entered on ACTIVITY
const timeoutMachine = Machine({
initial: 'idle',
strict: true,
states: {
idle: {
on: { ACTIVITY: 'idle' },
after: { 3000: 'timeout' },
},
timeout: {
on: { ACTIVITY: 'idle' },
},
},
});