Tomasz Krakowiak
05/11/2021, 12:44 PMval welcome: CBlock = {
tag(::DIV) {
css {
classes.add("welcome")
display = Display.none
}
+"Hello, "
tag(::SPAN) {
val classes = currentUser.map {
if (it == null) {
setOf("username", "usernameAnonymous")
} else {
setOf("username", "usernameLoggedIn")
}
}
bind(SPAN::classes, classes)
dynamic(currentUser) { +(it?.username ?: "you") }
}
+"."
}
}
It's coming!
Currently I'm looking for people willing to help me with design and development. No code contribution is necessary, advising on API design is not less valuable for me.
See live demo: http://tictactoe.demo.carrat.org/
Code: https://github.com/carrat-framework/carrat-demo-tictactoe/blob/master/src/commonMain/kotlin/org/carrat/demo/tictactoe/site/displayGame.kt
If you want to help, join #carrat-devaltavir
05/11/2021, 1:35 PMaltavir
05/11/2021, 1:35 PMTomasz Krakowiak
05/11/2021, 1:45 PMtag
method, binding is not possible, as it is not possible to implement it efficiently.Tomasz Krakowiak
05/11/2021, 1:48 PMandylamax
05/13/2021, 2:43 AM