Skip to content

Instantly share code, notes, and snippets.

@xomaczar
Created September 26, 2020 04:53
Show Gist options
  • Save xomaczar/d8db57bd68f5e3a21fff8d05108f3db4 to your computer and use it in GitHub Desktop.
Save xomaczar/d8db57bd68f5e3a21fff8d05108f3db4 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
const sessionInactivityMachine = Machine({
initial: 'active',
states: {
active: {
on: {
USER_INACTIVE: 'idle',
RENEW: 'active',
LOGOUT: 'disconnect',
}
},
idle: {
on: {
RENEW: 'active',
RENEW_TIMEOUT_REACHED: 'disconnect',
EXIT: 'disconnect'
}
},
disconnect: {
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment