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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.3.0
    5
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.3.0
    5
  • 0.2.1
    0
  • 0.2.0
    0
  • 0.1.0
    0

Package Sidebar

Install

npm i haunted-robot

Weekly Downloads

5

Version

0.3.0

License

BSD-2-Clause

Unpacked Size

2.41 kB

Total Files

3

Last publish

Collaborators

  • matthewp