Last active
          January 29, 2020 08:51 
        
      - 
      
- 
        Save joshpitzalis/a5477c28a1c4626b457111af3cfabcfd to your computer and use it in GitHub Desktop. 
Revisions
- 
        joshpitzalis revised this gist Jan 29, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewingThis file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -25,7 +25,7 @@ DESELECT_ALL: 'selection_screen', ADD_CONTACTS: 'add_contacts_button', }, initial: 'entireSelection', states: { entireSelection: { TOGGLE_FILTER: 'justTheConflicts' 
- 
        joshpitzalis revised this gist Jan 29, 2020 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewingThis file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -27,14 +27,14 @@ }, initial: 'allSelected', states: { entireSelection: { TOGGLE_FILTER: 'justTheConflicts' }, justTheConflicts: { on: { SELECTED_FIELD_TO_OVERWRITE:'justTheConflicts', SELECTED_FIELD_FOR_ALL_OVERWRITES:'justTheConflicts', TOGGLE_FILTER: 'entireSelection' } }, 
- 
        joshpitzalis revised this gist Jan 29, 2020 . 1 changed file with 18 additions and 11 deletions.There are no files selected for viewingThis file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -17,21 +17,28 @@ } }, selection_screen: { onEntry: 'deselectConflicts', on: { CONTACT_SELECTED: 'selection_screen', CONTACT_DESELECTED: 'selection_screen', SELECT_ALL: 'selection_screen', DESELECT_ALL: 'selection_screen', ADD_CONTACTS: 'add_contacts_button', }, initial: 'allSelected', states: { allSelected: { TOGGLE_FILTER: 'justTheConflicts' }, justTheConflicts: { on: { SELECTED_FIELD_TO_OVERWRITE:'justTheConflicts', SELECTED_FIELD_FOR_ALL_OVERWRITES:'justTheConflicts', TOGGLE_FILTER: 'allSelected' } }, } } } }); 
- 
        joshpitzalis revised this gist Jan 28, 2020 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewingThis file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -28,9 +28,9 @@ onEntry: 'checkForConflicts', on: { NO_CONFICTS_DETECTED: 'add_contacts_button', MERGED_CONTACT: 'conflict_screen', CREATED_FIELD_TO_OVERWRITE:'conflict_screen', SELECTED_FIELD_FOR_ALL_OVERWRITES:'conflict_screen', } } } 
- 
        joshpitzalis revised this gist Jan 28, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewingThis file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -29,7 +29,7 @@ on: { NO_CONFICTS_DETECTED: 'add_contacts_button', MERGED_CONTACTS: 'conflict_screen', CREATED_FIELD_TO_OVERWRITE:'conflict_screen', SELECTED_FIELD_FOR_ALL_OVERWRITES:'conflict_screen', } } 
- 
        joshpitzalis revised this gist Jan 28, 2020 . 1 changed file with 17 additions and 17 deletions.There are no files selected for viewingThis file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,37 +2,37 @@ 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', } } } }); 
 
- 
        joshpitzalis created this gist Jan 27, 2020 .There are no files selected for viewingThis file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,38 @@ const fetchMachine = Machine({ id: 'contacts', initial: 'idle', states: { idle: { on: { ADDED: 'permissions' } }, permissions: { on: { APPROVED: 'select', REJECTED: 'idle' } }, select: { on: { CONTACT_SELECTED: 'select', CONTACT_DESELECTED: 'select', SELECT_ALL: 'select', ADD_CONTACTS: 'conflict' } }, conflict: { onEntry: 'checkForConflicts', on: { NO_CONFICTS: 'contactAdded', MERGE_CONTACTS: 'conflict', CREATE_SEPERATE_CONTACTS: 'conflict' } }, contactAdded: { type: 'final'} } });