Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matthewp/robot
🤖 A functional, immutable Finite State Machine library
https://github.com/matthewp/robot
Last synced: 12 days ago
JSON representation
🤖 A functional, immutable Finite State Machine library
- Host: GitHub
- URL: https://github.com/matthewp/robot
- Owner: matthewp
- License: bsd-2-clause
- Created: 2019-09-09T11:44:29.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2024-07-18T01:42:31.000Z (4 months ago)
- Last Synced: 2024-10-25T21:07:35.114Z (16 days ago)
- Language: JavaScript
- Homepage: https://thisrobot.life
- Size: 1.47 MB
- Stars: 1,914
- Watchers: 19
- Forks: 88
- Open Issues: 33
-
Metadata Files:
- Readme: readme.md
- Contributing: contributing.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome - robot - 🤖 A functional, immutable Finite State Machine library (JavaScript)
- awesome-react-state-management - robot - A functional, immutable Finite State Machine library (List)
README
# Robot
A small functional and immutable Finite State Machine library. Using state machines for your components brings the declarative programming approach to application state.
See [thisrobot.life](https://thisrobot.life/) for the main documentation.
```js
import { createMachine, interpret, state, transition } from 'robot3';let machine = createMachine({
off: state(
transition('toggle', 'on')
),
on: state(
transition('toggle', 'off')
)
});const service = interpret(machine, () => {
render();
});
```## 📚 [Documentation](https://thisrobot.life/)
* Please star [the repository](https://github.com/matthewp/robot) on GitHub.
* [File an issue](https://github.com/matthewp/robot/issues) if you find a bug. Or better yet...
* [Submit a pull request](https://github.com/matthewp/robot/compare) to contribute.## Testing
Tests are located in the `test/` folder. Load `test/test.html` in your browser of choice with any HTTP server you like (I use [http-server](https://www.npmjs.com/package/http-server)). Tests are written in [QUnit](https://qunitjs.com/) and are simple to understand.
## Integrations
Robot works with a variety of UI libraries, and includes integrations for React, Preact, Haunted, and more. See the [integrations page](https://thisrobot.life/integrations.html) to learn more.
## License
BSD-2-Clause