Last active
June 9, 2021 14:49
-
-
Save james-a-rob/e776264f450315e98997e2fa24a70250 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 fetchMachine = Machine({ | |
id: 'fetch', | |
initial: 'initialising', | |
context: { | |
retries: 0 | |
}, | |
states: { | |
initialising: { | |
on: { | |
ASK_FOR_PERMISSIONS: 'awaitingPermissions' | |
} | |
}, | |
awaitingPermissions: { | |
on: { | |
ALLOWED: 'previewing', | |
DENIED: 'deniedPermissions' | |
} | |
}, | |
deniedPermissions:{ | |
on: { | |
ASK_FOR_PERMISSIONS: 'awaitingPermissions' | |
} | |
}, | |
previewing: { | |
on: { | |
START: 'startingBroadcast' | |
} | |
}, | |
startingBroadcast: { | |
on: { | |
ERROR:'error', | |
SUCCESS: 'live' | |
} | |
}, | |
live: { | |
on: { | |
ERROR: 'error', | |
END: 'ended' | |
} | |
}, | |
ended: { | |
on: { | |
START: 'live' | |
} | |
}, | |
error:{ | |
on:{ | |
RETRY: 'initialising' | |
} | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment