haunted-robot

0.3.0 • Public • Published

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

License

BSD-2-Clause

/haunted-robot/

    Package Sidebar

    Install

    npm i haunted-robot

    Weekly Downloads

    1

    Version

    0.3.0

    License

    BSD-2-Clause

    Unpacked Size

    2.41 kB

    Total Files

    3

    Last publish

    Collaborators

    • matthewp