Sign in Go Pro

Kotlin

Delegation Using Delegates.observable

 
Autoplay

Previous

About

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 Delegates.observable
  • How to use Delegates.observable with custom classes

Instructor

Links

Comments

it's not that hard to create it from scratch using functions or interfaces like the java style, I wonder why they are adding it to the kotlin core api..?

You really need to work on your English pronunciation before putting more videos online

no pun intended

Miroslav, I feel that comment was unnecessary and rude. All of our instructors come from various ethnic backgrounds and do their best to teach content in a common venacular and language (English). We have provided closed captions for this lesson which you can enable to help guide you through areas that difficult for you to understand. Please attempt to reframe comments like these or refrain from posting them if they cannot be constructive.

I wanted to know what practical use cases do Delegates.observable hold rather than debugging purposes.

Pronunciation :(
Halooooo: Value!

>
You need to go PRO to post comments.

Lessons in Kotlin