Skip to content

Instantly share code, notes, and snippets.

@fponticelli
Last active July 2, 2020 23:39
Show Gist options
  • Save fponticelli/cfa9ff56867e24a4224c557156af781e to your computer and use it in GitHub Desktop.
Save fponticelli/cfa9ff56867e24a4224c557156af781e to your computer and use it in GitHub Desktop.
import { Tempo } from 'tempo-dom/lib/tempo'
import { simpleComponent } from 'tempo-dom/lib/html'
const component = simpleComponent<number, unknown>($ =>
$.div($ =>
$.class('app').div($ =>
$.div($ => $.class(['count', 'count-small']).text('count'))
.div($ => $.class('count').text(String))
.div($ =>
$.class('buttons')
.button($ =>
$.onClick(count => count - 1)
.disabled(count => count <= 0)
.text('-')
)
.button($ => $.onClick(count => count + 1).text('+'))
)
)
)
)
Tempo.renderSimple({ component, state: 0 })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment