Last active
          February 20, 2020 04:09 
        
      - 
      
- 
        Save joshpitzalis/e51de4a18bd4d19a84ecb3f15bba5ef2 to your computer and use it in GitHub Desktop. 
Revisions
- 
        joshpitzalis revised this gist Feb 20, 2020 . No changes.There are no files selected for viewing
- 
        joshpitzalis created this gist Feb 20, 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,45 @@ // Available variables: // - Machine // - interpret // - assign // - send // - sendParent // - spawn // - raise // - actions // - XState (all XState exports) const fetchMachine = Machine({ id: 'contactChunks', initial: 'idle', states: { idle: { on: { FETCHED: 'loading', ALREADY_FETCHED:'selector', } }, loading: { on: { RESOLVED: 'selector', REJECTED: 'error' } }, selector: { onEntry: ['deduplicate', 'preSelect'], on: { SELECTED: 'selector', CANCELLED: 'idle', REVEALED_MORE:'selector', } }, error: { on: { RETRIED: 'loading' } } } });