0.3.0 • Published 1 year ago

react-robot v0.3.0

Weekly downloads
530
License
BSD-2-Clause
Repository
github
Last release
1 year ago

react-robot

React hooks for use with Robot finite state machines.

See documentation on the website.

import { useMachine } from 'react-robot';
import React from 'react';
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

0.3.0

1 year ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago