Created
April 15, 2020 18:52
-
-
Save tmlangley/b88d40288e2606566cad38d409c71978 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 FiltersMachine = Machine({ | |
id: 'filters', | |
initial: 'loading', | |
context: { | |
results: [], | |
filterParams: [] | |
}, | |
states: { | |
loading: { | |
initial: 'fetchingAllFilterOptions', | |
states: { | |
fetchingAllFilterOptions: { | |
after: { | |
1500: '#filtersSuccess' | |
}, | |
exit: sendParent('FILTERS_READY') | |
}, | |
refiningFilters: { | |
after: { | |
1500: '#filtersSuccess', | |
}, | |
exit: sendParent('FILTERS_READY') | |
} | |
}, | |
}, | |
success: { | |
id: 'filtersSuccess', | |
on: { | |
REFINE_FILTERS: 'loading.refiningFilters', | |
} | |
}, | |
failure: { | |
on: { | |
RETRY: 'loading' | |
} | |
} | |
}}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment