Overview
Svelte FSMA is a tiny, simple, expressive, and pragmatic Finite State Machine (FSM) library optimized for Svelte. It is under 1kb when minified and has zero dependencies. The library prioritizes developer happiness and implements the Svelte store contract, making it feel at home in a Svelte codebase. With its intuitive API and mapping of FSM constructs to core JavaScript features, Svelte FSMA offers a highly expressive and effortless experience for building and using FSMs in Svelte components.
Features
- Tiny: The library is under 1kb when minified.
- Simple: Svelte FSMA implements core FSM features without unnecessary complexities.
- Expressive: FSM constructs in Svelte FSMA are intuitively mapped to core JavaScript language features, resulting in a highly expressive API that is easy to remember, write, and read.
- Pragmatic: The library prioritizes developer happiness and practicality over strict adherence to FSM or Statechart formalizations.
- Svelte-optimized: Svelte FSMA implements the Svelte store contract and is philosophically aligned with the Svelte framework.
Installation
To install Svelte FSMA, you can use a package manager like npm or yarn:
npm install svelte-fsma
or
yarn add svelte-fsma
Once installed, you can import the library in your Svelte component:
import fsm from 'svelte-fsma';
Summary
Svelte FSMA is a lightweight and powerful FSM library optimized for Svelte. It offers a simple and expressive API that makes it easy to build and use FSMs in Svelte components. With its tiny size, zero dependencies, and Svelte-optimized design, Svelte FSMA is a valuable tool for developers looking to incorporate FSMs into their Svelte projects.