Created
May 21, 2020 16:28
-
-
Save signaes/76bfcca1c463ca165e1ba930723eb574 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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions | |
// - XState (all XState exports) | |
const BACK_TO_DASHBOARD = { target: 'dashboard' } | |
const config = { | |
id: 'financesDashboard', | |
initial: 'idle', | |
states: { | |
idle: { | |
initial: 'dashboard', | |
states: { | |
dashboard: { | |
on: { | |
NEW_ACCOUNT: { target: 'account.new' }, | |
PRODUCTS: { target: 'products' }, | |
}, | |
}, | |
account: { | |
initial: 'idle', | |
on: { BACK_TO_DASHBOARD }, | |
states: { | |
idle: {}, | |
new: {}, | |
}, | |
}, | |
invoices: { | |
on: { BACK_TO_DASHBOARD }, | |
}, | |
products: { | |
initial: 'idle', | |
on: { | |
BACK_TO_DASHBOARD, | |
EDIT: { target: 'products.edit' }, | |
CREATE: { target: 'products.create' }, | |
}, | |
states: { | |
idle: {}, | |
edit: {}, | |
create: {}, | |
}, | |
}, | |
statetement: { | |
on: { BACK_TO_DASHBOARD }, | |
}, | |
subscriptions: { | |
on: { BACK_TO_DASHBOARD }, | |
}, | |
}, | |
}, | |
}, | |
} | |
const options= {} | |
const financesDashboardMachine = Machine(config, options) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment