Preact hooks for Robot finite state machines
npm install preact-robotPreact hooks for use with Robot.
See documentation on the website.
``js
import { useMachine } from 'preact-robot';
import { h } from 'preact';
import { html } from 'htm/prect';
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
;``
}
* Please star the repository on GitHub.
* File an issue if you find a bug. Or better yet...
* Submit a pull request to contribute.
BSD-2-Clause