Skip to content

Instantly share code, notes, and snippets.

@easilyBaffled
easilyBaffled / machine.js
Last active August 5, 2021 13:49
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: "fetch",
initial: "idle",
context: {
retries: 0,
},
states: {
idle: {
on: {
commit: "pre-commit hook",
import "./styles.scss";
import level1 from "./levels/level-1";
import { createShakeAnimation } from "./shakeAnimation";
const gridSize = parseInt(
getComputedStyle(document.body).getPropertyValue("--grid-size"),
10
);
const tileSize = parseInt(
getComputedStyle(document.body).getPropertyValue("--tile-size"),
@easilyBaffled
easilyBaffled / machine.js
Created December 18, 2019 17:03
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)