A State Machine walks into a Svelte Component
summary
Built a tiny Svelte-oriented FSM called svelte-fsm that exports a single function and adds about <1 KB to the bundle. It implements the Svelte store contract so you use $state in templates, supports actions as functions, and has an enter lifecycle hook used to kick off async work; demo includes a toggle and a form with four states (entering → submitting → completed / invalid) where promises dispatch success or failure transitions. TypeScript support is limited and no hierarchical states yet.
AI-written summary · about
chapters (7)
- 0:00Introduction
- 1:09Zendever project
- 2:22Finite state machines 101
- 4:28Basic toggle example
- 5:29Practical form example
- 5:50Async state handling
- 6:00Form UI implementation
related talks
20mTaming UI complexity with Typed State Machines
28mState machines for frontend state management
24mSvelte: the last framework we need?
46mFinite-state machines? Your compiler wants in!
40mSvelte is Fast and Makes You Faster
30mMastering UIs with Finite State Machines
20mSetState, We Need to Talk!
25mMastering UIs with Finite State Machines
