JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3758
  • Score
    100M100P100Q112061F
  • License BSD-2-Clause

React hooks for Robot finite state machines

Package Exports

  • react-robot

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-robot) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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