Last active
April 30, 2021 09:46
-
-
Save LostKobrakai/249f2cc6395b06c04d4b3ee219ce8483 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions | |
// - XState (all XState exports) | |
const fetchMachine = Machine({ | |
id: 'restart_timer', | |
initial: 'normal', | |
states: { | |
normal: { | |
on: { | |
tick: { | |
actions: ['check_edith'] | |
}, | |
app_down: 'critical' | |
} | |
}, | |
critical: { | |
entry: ['start_timeout'], | |
on: { | |
tick: { | |
actions: ['check_edith'] | |
}, | |
stop_timeout: 'deferred', | |
app_up: 'normal', | |
timeout: { | |
target: 'normal', | |
actions: ['run_stop'] | |
}, | |
} | |
}, | |
deferred: { | |
on: { | |
tick: { | |
actions: ['check_edith'] | |
}, | |
app_up: 'normal' | |
} | |
} | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment