lit-robot

1.0.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>
    `;
  }
}

License

BSD-2-Clause

/lit-robot/

    Package Sidebar

    Install

    npm i lit-robot

    Weekly Downloads

    41

    Version

    1.0.0

    License

    BSD-2-Clause

    Unpacked Size

    2.68 kB

    Total Files

    3

    Last publish

    Collaborators

    • matthewp