kt-mvvm / com.dukescript.api.kt / Model


fun Model(thiz: Provider): Model

Instantiates new Model associated with provided thiz object. The model holds all necessary data for communication with JavaScript (or any other) implementation. If you have an object that you want to mirror in the other side, create a class and implement Model.Provider - it has just a single read only property - implement it by instantiating the Model instance with a pointer to your object.

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

    public var value: Int by observable(0)