Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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"
- }
Add Comment
Please, Sign In to add comment