Added delegated property through map support + tests.

This commit is contained in:
Igor Chevdar
2017-02-28 15:44:06 +03:00
parent 889b28ee87
commit e2f2e31dc1
6 changed files with 183 additions and 0 deletions
@@ -0,0 +1,14 @@
import kotlin.properties.Delegates
class User {
var name: String by Delegates.observable("<no name>") {
prop, old, new ->
println("$old -> $new")
}
}
fun main(args: Array<String>) {
val user = User()
user.name = "first"
user.name = "second"
}