Skip to content

Instantly share code, notes, and snippets.

@leoplaw
Last active August 25, 2021 19:14
Show Gist options
  • Save leoplaw/fe8ec3b188a6c8574277208a8ddcefd9 to your computer and use it in GitHub Desktop.
Save leoplaw/fe8ec3b188a6c8574277208a8ddcefd9 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 tokenSelectMachine = Machine({
id: "tokenSelect",
initial: "idle",
states: {
idle: {
on: {
LOADED: {
target: "show"
}
}
},
show: {
on: {
CLICK: {
target: "active"
}
}
},
active: {
on: {
INPUT: {
target: "search"
},
DEACTIVATE: {
target: "show"
}
}
},
search: {
on: {
RESULTS: {
target: "active"
},
SELECT: {
target: "update"
}
}
},
update: {
on: {
UPDATED: {
target: "show"
}
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment