Skip to content

Instantly share code, notes, and snippets.

@LarryStanley
Last active August 4, 2021 17:04
Show Gist options
  • Save LarryStanley/906736c3ec5c2abc6c1963c90c5df2cc to your computer and use it in GitHub Desktop.
Save LarryStanley/906736c3ec5c2abc6c1963c90c5df2cc 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 scheduleMachine = Machine({
id: 'scheduleMachine',
initial: 'login',
context: {
},
states: {
login: {
initial: 'blank',
states: {
blank: {
on: {
CLICK_LOGIN: 'loading'
}
},
loading: {
},
error: {
},
success: {
after: {
500: {
target: '#group_list'
}
}
}
}
},
group_list: {
id: 'group_list',
on: {
CLICK_LOGOUT: 'logout',
SWITCH_GROUP: 'group',
CLICK_CREATE_GROUP: 'create_group'
}
},
create_group: {
on: {
SUCCESS: 'group'
}
},
group: {
initial: 'manager',
on: {
CLICK_LOGOUT: 'logout'
},
states: {
manager: {
initial: 'setting_shifts',
states: {
setting_shifts: {
},
setting_workers: {
},
schedule: {
}
}
},
worker: {
initial: 'setting_available_shifts',
states: {
setting_available_shifts: {
},
schedule: {
}
}
}
}
},
logout: {
on: {
CLICK_LOGIN: 'login'
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment