Added delegated property through map support + tests.
This commit is contained in:
@@ -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"
|
||||
}
|
||||
Reference in New Issue
Block a user