Created
January 3, 2024 18:39
-
-
Save SandroMaglione/f4b8082e57392439c9d3cf4a35c5800c to your computer and use it in GitHub Desktop.
Setup code for an empty state machine in XState v5
This file contains hidden or 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
import { setup } from "xstate"; | |
const machine = setup({ | |
types: { | |
context: {} as {}, | |
events: {} as { readonly type: "event"; readonly params: {} }, | |
}, | |
actions: {}, | |
}).createMachine({ | |
id: "machine", | |
context: {}, | |
initial: "Init", | |
states: { | |
Init: {}, | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment