The observable function gives you a delegate property that accepts a function that will be invoked each time a property changes:
var observable by Delegates.observable(1) { prop, oldVal, newVal ->
println("Observable property changed from $oldVal to $newVal")
}
If we now change the property, the lambda function will be invoked:
//this prints Observable property changed from 1 to 0
observable = 0