New Kotlin Feature - Explicit Backing Fields 🤩

This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).

Kotlin 2.0 introduces explicit backing fields, a new language feature that eliminates the need to define two separate variables (a private mutable and a public immutable) to represent a single state. With this feature, you can declare a single property with both a mutable backing field and an immutable public type, such as StateFlow. The feature must be enabled in the Gradle build file.

•1m watch time

Sort: