What are the use cases for Delegates.observable
when we can just use property setters?
var foo by Delegates.observable("hell0") { prop, old, new ->
// react to changes in foo
}
var bar = "hello"
set(value) {
field = value
// react to changes in bar
// we can also do validation, set something like `value*2` to field, etc.
}
Delegates.observable()
provides access to the property (and oldValue) being observed. – Correspond