Skip to content

Instantly share code, notes, and snippets.

@deebloo
Last active August 23, 2020 23:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deebloo/32e99e39db5c5307fff4528f6c7d28c8 to your computer and use it in GitHub Desktop.
Save deebloo/32e99e39db5c5307fff4528f6c7d28c8 to your computer and use it in GitHub Desktop.
import { component, State, JoistElement, get } from '@joist/component';
import { template, html } from '@joist/component/lit-html';
@component<number>({
tagName: 'my-counter',
state: 'Hello',
render: template(({ state }) => html`${state}`)
})
class MyCounterElement extends JoistElement {
@get(State)
private state!: State<number>;
connectedCallback() {
super.connectedCallback();
const res = Promise.resolve('World');
this.state.setValue(res);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment