Last active
August 23, 2020 23:24
-
-
Save deebloo/32e99e39db5c5307fff4528f6c7d28c8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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