lit-robot

0.3.0 • Public • Published

lit-robot

LitElement integration with Robot.

See documentation on the website.

import { Robot } from 'lit-robot';
import { LitElement, html } from 'lit-element';
import { html } from 'htm/prect';

class MyApp extends Robot(LitElement) {
  static machine = createMachine({
    one: state(
      transition('next', 'two')
    ),
    two: state()
  });

  render() {
    let { send } = this.service;
    let current = this.machine.state;

    return html`
      <button type="button" @click=${() => send('next')}>
        State: ${current.name}
      </button>
    `;
  }
}

📚 Documentation

License

BSD-2-Clause

Package Sidebar

Install

npm i lit-robot

Weekly Downloads

28

Version

0.3.0

License

BSD-2-Clause

Unpacked Size

2.68 kB

Total Files

3

Last publish

Collaborators

  • matthewp