Skip to content

Instantly share code, notes, and snippets.

@joshpitzalis
Last active January 29, 2020 08:51
Show Gist options
  • Save joshpitzalis/a5477c28a1c4626b457111af3cfabcfd to your computer and use it in GitHub Desktop.
Save joshpitzalis/a5477c28a1c4626b457111af3cfabcfd to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: 'contacts',
initial: 'add_contacts_button',
states: {
add_contacts_button: {
on: {
ADDED: 'permission_screen'
}
},
permission_screen: {
on: {
APPROVED: 'selection_screen',
REJECTED: 'add_contacts_button'
}
},
selection_screen: {
on: {
CONTACT_SELECTED: 'selection_screen',
CONTACT_DESELECTED: 'selection_screen',
SELECT_ALL: 'selection_screen',
ADD_CONTACTS: 'conflict_screen'
}
},
conflict_screen: {
onEntry: 'checkForConflicts',
on: {
NO_CONFICTS_DETECTED: 'add_contacts_button',
MERGED_CONTACTS: 'conflict_screen',
CREATEDED_FIELD_TO_OVERWRITE:'conflict_screen',
SELECTED_FIELD_FOR_ALL_OVERWRITES:'conflict_screen',
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment