We love Kotlin. We love MVVM!


#1

Hi.
We love Kotlin. We love MVVM. This is the result: http://kt-mvvm.org
We’d like to know what you guys think about this idea! Here is the model:

class Demo : Model.Provider {
    override val objs = Model(this)

    var desc by observable("")
    val todos: MutableList<String> by observableList()

    val addTodo by action {
        todos += desc
        desc = ""
    }
}

and here comes the view:

<label for="key">New Todo:</label>
<input id="key" type="text" data-bind="textInput: desc"/>
<button data-bind="click: addTodo">Add</button>
<ul class="todos" data-bind='foreach: todos'>
  <li>
    <span data-bind="text: $data"></span> 
  </li>
</ul> 

More details including sample Gradle or Maven project and dokka documentation available at http://kt-mvvm.org

This is our first attempt to engage with the Kotlin community and we’d be thankful for any feedback. We believe MVVM is a great coding approach for creating portable applications. The DukeScript project has already demonstrated it for Java, but we’d like to simplify writing the type-safe models and Kotlin is a great language for doing that. We just need a slight push into the right direction…

Thanks for any comments.
-s-