Last active
August 25, 2021 19:14
-
-
Save leoplaw/fe8ec3b188a6c8574277208a8ddcefd9 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 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