Nicely Presented Misnomer

npm

Need private packages and team management tools?Check out npm Orgs. »

react-robot

0.2.1 • Public • Published

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

install

npm i react-robot

Downloadsweekly downloads

13

version

0.2.1

license

BSD-2-Clause

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability