Closed TodePond closed 1 year ago
const score = use(0)
const doubled = use(() => score.value * 2)
const tripled = use(() => score.value * 3, { lazy: true })
const position = use([5, 10])
const dimensions = use([20, 30], { store: false })
const bottom = use(() => position.y + dimensions.height)
const display = HTML("<div></div>")
use(() => display.textContent = score.value)
const player = use({ name: "Player" })
const card = HTML("<div></div>")
const signal = use(() => card.textContent = player.name, { lazy: true })
signal.update()
score.addEventListener("update", () => print("Score updated"))
or nah?