Last active
July 2, 2020 23:39
-
-
Save fponticelli/cfa9ff56867e24a4224c557156af781e 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 { 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