Skip to content

Instantly share code, notes, and snippets.

@s-m-i-t-a
Last active March 25, 2020 18:03
Show Gist options
  • Save s-m-i-t-a/42f62c5eeb09db5b7afc5065704753f8 to your computer and use it in GitHub Desktop.
Save s-m-i-t-a/42f62c5eeb09db5b7afc5065704753f8 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
const createApp = Machine({
id: 'create app',
initial: 'init',
states: {
init: {
on: {
STORE: 'db'
}
},
db: {
on: {
'': 'install'
}
},
install: {
type: 'parallel',
states: {
app: {
initial: 'install',
states: {
install: {
on: {
APP_DONE: 'done',
APP_ERROR: 'error'
}
},
done: {
type: 'final'
},
error: {
}
}
},
services: {
initial: 'create',
states: {
create: {
on: {
SERVICES_DONE: 'done',
SERVICES_ERROR: 'error'
}
},
done: {
type: 'final'
},
error: {
}
}
}
},
onDone: 'env'
},
env: {
on: {
ENV_SAVED: 'start_app',
ENV_ERROR: 'error'
}
},
start_app: {
on: {
STARTED: 'done',
FAILED: 'error'
}
},
done: {type: 'final'},
error: {}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment