not sure I understand it completely, but I would d...
# javascript
o
not sure I understand it completely, but I would do it like this
Copy code
fun fun FlowContent.widget(caption: String, data: String, body: FlowContent.() -> Unit) {
  li { 
    span { +caption }
    span {
      when (data) {
        "checkbox" -> { … body() … }
        "radio" -> {… body() … }
      }
    }
  }
}