I'm playing with kotlin->javascript and i'm try...
# announcements
d
I'm playing with kotlin->javascript and i'm trying to wrap a javascript library to abstract it away. i've got this working:
Copy code
@native("someLibrary.extendObservable")
fun extendObservable(instance: Any, props: dynamic)

class Counter {
    var count: Int = 0
    val twice: Int
        get() { return count * 2 }

    // The following bit is for javascript interop with the extendObservable function
    init {
        extendObservable(this, object {
            var count = this@Counter.count
            val twice: Int get() { return this@Counter.twice }
        })
    }
}
Any ideas on factoring out that
init { ... }
stuff?