Skip to content

Instantly share code, notes, and snippets.

@SandroMaglione
Created July 4, 2024 12:41
Show Gist options
  • Select an option

  • Save SandroMaglione/bbe1a6878f5fd92d6b87b59911c8550c to your computer and use it in GitHub Desktop.

Select an option

Save SandroMaglione/bbe1a6878f5fd92d6b87b59911c8550c to your computer and use it in GitHub Desktop.

Revisions

  1. SandroMaglione created this gist Jul 4, 2024.
    17 changes: 17 additions & 0 deletions machine.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    {
    "state machine": {
    "prefix": "machine",
    "description": "Create scaffold for state machine",
    "body": [
    "import { setup } from \"xstate\";",
    "",
    "export const machine = setup({}).createMachine({",
    " id: \"$0\",",
    " initial: \"Idle\",",
    " states: {",
    " Idle: {},",
    " },",
    "});",
    ]
    },
    }