is there a way to create a `Delegates.observable` ...
# announcements
l
is there a way to create a
Delegates.observable
of a read-only property? e.g.
Copy code
data class Foo(bar:Boolean, car:Boolean)
val foo by Delegates.observable(Foo(false,false)){...}
foo.bar = true
g
Observable field cannot detect such changes and notify.
Copy code
foo.bar = true
To do that bar must be Delegates.observable itself
l
hmm 😕 ty, I just found out from the docs
d
Maybe you could make the setter private though?
g
make the setter private though
But sample code itself is impossible, you cannot observe changes of nested property (foo.bar), you can observe changes of foo itself