haunted-robot
v1.0.0
Published
Haunted hooks for Robot finite state machines
Downloads
74
Maintainers
Readme
haunted-robot
Haunted hooks for use with Robot.
See documentation on the website.
import { useMachine } from 'haunted-robot';
import { html, component } from 'haunted';
import { createMachine, state, transition } from 'robot3';
const machine = createMachine({
one: state(
transition('next', 'two')
),
two: state()
});
function App() {
const [current, send] = useMachine(machine);
return html`
<button type="button" @click=${() => send('next')}>
State: ${current.name}
</button>
`;
}
customElements.define('my-app', component(App));
📚 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