Skip to content

Instantly share code, notes, and snippets.

View machine.js
const petting = {
id: 'petting',
initial: 'establish_token',
states: {
// check token with server
establish_token: {
initial: 'parse_token',
meta: { screenId: 'welcome' },
states: {
parse_token: {
View machine.js
const fetchMachine = Machine({
id: 'video',
initial: 'petting',
states: {
petting: {
initial: 'check_token',
states: {
check_token: {
initial: 'waiting_for_response',