xstate-viz icon indicating copy to clipboard operation
xstate-viz copied to clipboard

Delay animation does not restart

Open sphire opened this issue 6 years ago • 0 comments

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' },
    },
  },
});

sphire avatar Apr 03 '19 14:04 sphire