Reactive Approach to Delegation in Kotlin
summary
Shows how Kotlin's class and property delegation (using the by keyword) is used to build a custom button with three explicit states (showLiked, showUnliked, sendComment) that morphs a heart into a send icon, driven by a single observable property that receives old/new values and triggers animations. Demonstrates lazy to defer heavy init, map delegates to bind JSON keys to properties, and a filterable delegate to reject invalid updates, claiming less boilerplate, immediate UI updates, and clearer state handling via sealed classes.
AI-written summary · about
chapters (10)
- 0:00Introduction to delegation
- 2:06Explicit vs implicit delegation
- 6:21Delegated properties in Kotlin
- 10:14Lazy delegated property
- 15:32Not-null delegated property
- 17:39Map as delegated property
- 20:30Observable delegated property
- 24:07Filterable delegated property
- 26:58Custom views with delegation
- 34:03Conclusion and resources








