While writing programs, we often need to monitor changes made to the value of a variable. For this purpose, most of the time we implement custom setters and call a function from there, which can make a program quite complex.
Fortunately, Kotlin comes to our aid with the
Delegates.observable delegate, which is, among the standard delegates in Kotlin.
In this lesson you will learn:
- How the Delegates.observable delegation works
- How to monitor a variable with
- How to use
Delegates.observablewith custom classes