Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shazron/robot
🤖 A functional, immutable Finite State Machine library
https://github.com/shazron/robot
Last synced: 3 months ago
JSON representation
🤖 A functional, immutable Finite State Machine library
- Host: GitHub
- URL: https://github.com/shazron/robot
- Owner: shazron
- License: bsd-2-clause
- Fork: true (matthewp/robot)
- Created: 2019-10-16T02:24:21.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-07T15:34:43.000Z (over 3 years ago)
- Last Synced: 2023-04-01T10:58:13.645Z (over 1 year ago)
- Language: JavaScript
- Homepage: https://thisrobot.life
- Size: 549 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
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