Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrating with reactive system components #181

Closed
Tracked by #113
dineug opened this issue Feb 19, 2021 · 0 comments
Closed
Tracked by #113

Integrating with reactive system components #181

dineug opened this issue Feb 19, 2021 · 0 comments
Labels
v2 v2.0.0

Comments

@dineug
Copy link
Owner

dineug commented Feb 19, 2021

Project: lit-observable

import { defineComponent, html, observable } from '@dineug/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);
@dineug dineug added the v2 v2.0.0 label Feb 19, 2021
@dineug dineug mentioned this issue Apr 11, 2021
@dineug dineug closed this as completed Apr 11, 2021
This was referenced Apr 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v2 v2.0.0
Projects
None yet
Development

No branches or pull requests

1 participant