Skip to content

Instantly share code, notes, and snippets.

@bwaidelich
Last active February 17, 2021 13:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bwaidelich/b2680e8a77ae2b0e01bfbf42de75fba2 to your computer and use it in GitHub Desktop.
Save bwaidelich/b2680e8a77ae2b0e01bfbf42de75fba2 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const machine = Machine({
id: 'doctor',
initial: 'idle',
states: {
idle: {
type: 'parallel',
states: {
aok: {
initial: 'idle',
states: {
idle: {
on: {
EDIT_AOK_FIELD: 'pending_changes',
}
},
pending_changes: {
on: {
EDIT_AOK_FIELD: 'pending_changes',
START_REVIEW: 'locked'
}
},
locked: {
on: {
ACCEPT: 'updating',
DECLINE: 'idle',
}
},
updating: {
after: {
500: 'idle'
}
}
}
},
medray: {
initial: 'idle',
states: {
idle: {
on: {
EDIT_MEDRAY_FIELD: 'pending_changes',
}
},
pending_changes: {
on: {
EDIT_MEDRAY_FIELD: 'pending_changes',
SEND_TO_MEDRAY: 'locked'
}
},
locked: {
on: {
UPDATE_FROM_MEDRAY: 'updating',
}
},
updating: {
after: {
500: 'idle'
}
}
}
}
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment