@iteria-app/lit-observable
TypeScript icon, indicating that this package has built-in type declarations

0.2.2 • Public • Published

lit-observable

lit-html + reactive

npm version GitHub PRs CI

Install

$ yarn add @vuerd/lit-observable
or
$ npm install @vuerd/lit-observable

Usage

import { defineComponent, html, observable } from '@vuerd/lit-observable';

defineComponent('my-counter', {
  render() {
    const state = observable({ count: 0 });

    const onIncrement = () => {
      state.count++;
    };

    return () => html`
      <button @click=${onIncrement}>Increment</button>
      <span>${state.count}</span>
    `;
  },
});

const myCounter = document.createElement('my-counter');
document.body.appendChild(myCounter);

Package Sidebar

Install

npm i @iteria-app/lit-observable

Weekly Downloads

0

Version

0.2.2

License

MIT

Unpacked Size

109 kB

Total Files

11

Last publish

Collaborators

  • jslezak