Skip to content

Instantly share code, notes, and snippets.

@Sunil6591
Sunil6591 / machine.js
Last active August 12, 2021 05:21
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@Sunil6591
Sunil6591 / machine.js
Last active August 9, 2021 13:40
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@Sunil6591
Sunil6591 / machine.js
Created November 2, 2020 05:04
Generated by XState Viz: https://xstate.js.org/viz
const reportCardMachine = Machine({
// not a parallel machine
id: 'report_card',
initial: 'draft',
states: {
draft: {
on: { SUBMIT: 'pending' }
},
allcomplete: {
type: 'final'
@Sunil6591
Sunil6591 / machine.js
Created October 27, 2020 04:59
Generated by XState Viz: https://xstate.js.org/viz
const reportCardMachine = Machine({
// not a parallel machine
id: 'report_card',
initial: 'draft',
states: {
draft: {
on: { SUBMIT: 'pending' }
},
allcomplete: {
type: 'final'
@Sunil6591
Sunil6591 / machine.js
Created October 26, 2020 06:57
Generated by XState Viz: https://xstate.js.org/viz
const reportCardMachine = Machine({
// not a parallel machine
id: 'report_card',
initial: 'draft',
states: {
draft: {
on: { SUBMIT: 'pending' }
},
// nested parallel machine
pending: {
[
"‘S",
"‘s",
"‘T",
"‘t",
"A",
"a",
"Aan",
"aan",
"Aan ‘t",
@Sunil6591
Sunil6591 / machine.js
Created March 22, 2020 09:24
Generated by XState Viz: https://xstate.js.org/viz
const vacationRequestMachine = Machine({
id: 'draft',
initial: 'draft',
context: {
user: {
roles: ['admin'],
},
payload: {
vacationDates: [],
}
@Sunil6591
Sunil6591 / machine.js
Created March 15, 2020 09:07
Generated by XState Viz: https://xstate.js.org/viz
const vacationRequestMachine = Machine({
id: 'draft',
initial: 'draft',
context: {
user: {
roles: ['admin'],
},
payload: {
vacationDates: [],
}
@Sunil6591
Sunil6591 / vacationRequestMachine.js
Created March 15, 2020 09:05
xstate vacation request machine
const vacationRequestMachine = Machine({
id: 'draft',
initial: 'draft',
context: {
user: {
roles: ['admin'],
},
payload: {
vacationDates: [],
}
@Sunil6591
Sunil6591 / machine.js
Last active March 11, 2020 13:16
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions