lit-robot
v1.0.0
Published
LitElement hooks for Robot finite state machines
Downloads
115
Maintainers
Readme
lit-robot
LitElement integration with Robot.
See documentation on the website.
import { Robot } from 'lit-robot';
import { LitElement, html } from 'lit-element';
import { html } from 'htm/prect';
class MyApp extends Robot(LitElement) {
static machine = createMachine({
one: state(
transition('next', 'two')
),
two: state()
});
render() {
let { send } = this.service;
let current = this.machine.state;
return html`
<button type="button" @click=${() => send('next')}>
State: ${current.name}
</button>
`;
}
}
📚 Documentation
- Please star the repository on GitHub.
- File an issue if you find a bug. Or better yet...
- Submit a pull request to contribute.
License
BSD-2-Clause