1.1.0 • Published 5 months ago

preact-robot v1.1.0

Weekly downloads
86
License
BSD-2-Clause
Repository
github
Last release
5 months ago

preact-robot

Preact hooks for use with Robot.

See documentation on the website.

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`
    <button type="button" onClick=${() => send('next')}>
      State: ${current.name}
    </button>
  `;
}

📚 Documentation

License

BSD-2-Clause

1.1.0

5 months ago

1.0.0

7 months ago

0.3.0

2 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago