Created
April 27, 2021 17:42
-
-
Save beresmate/c25416ddd912b310b81978731117c90e 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 mhrMachine = Machine({ | |
id: 'mhrMachine', | |
initial: 'metaData', | |
states: { | |
metaData: { | |
initial: 'empty', | |
states: { | |
empty: { | |
on: { | |
METADATA_CACHE_REUSED: 'populated', | |
METADATA_LOADING: 'loading' | |
} | |
}, | |
loading: { | |
on: { | |
METADATA_LOAD_SUCCESS: 'populated', | |
METADATA_LOAD_FAILED: 'failed' | |
} | |
}, | |
failed: {}, | |
populated: { | |
initial: 'searchParams', | |
states: { | |
searchParams: { | |
initial: 'empty', | |
states: { | |
empty: { | |
on: { | |
SEARCHPARAMS_ADDED: 'populated' | |
} | |
}, | |
populated: { | |
initial: 'unknown', | |
states: { | |
unknown: { | |
on: { | |
SEARCHPARAMS_VALIDATION_PASSED: 'valid', | |
SEARCHPARAMS_VALIDATION_FAILED: 'invalid' | |
} | |
}, | |
valid: { | |
initial: 'referenceData', | |
states: { | |
referenceData: { | |
initial: 'empty', | |
states: { | |
empty: { | |
on: { | |
REFERENCE_DATA_LOADING: 'loading' | |
} | |
}, | |
loading: { | |
on: { | |
REFERENCE_DATA_LOADED: 'populated', | |
REFERENCE_DATA_LOADING_FAILED: 'failed' | |
} | |
}, | |
failed: {}, | |
populated: { | |
on: { | |
REFERENCE_DATA_LOADING: 'loading' | |
} | |
} | |
} | |
} | |
} | |
}, | |
invalid: {} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment