Last active
February 17, 2021 13:52
-
-
Save bwaidelich/b2680e8a77ae2b0e01bfbf42de75fba2 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains 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
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