From the course: Kotlin Multiplatform Development
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Going with the flow - Kotlin Tutorial
From the course: Kotlin Multiplatform Development
Going with the flow
- [Instructor] If you've used reactive coding methods, you'll find Kotlin coroutine flows immediately familiar. Much like observables and subjects in Rx flows offer a means of watching a value as a stream of values that changes over time while we observe it. In the case of database programming flows allow us a mean to watch values in our database and to react immediately in the user interface whenever any value changes. SQL Delight offers the possibility to query our database in a manner that observes the stream of updated values as a Kotlin flow. To do this, we first need a new library. We added it already here, but that is SQL Delight coroutines, extensions. So we go into this Libs versions 2 ML file in the Gradle directory and add this right? If we haven't already, we can then add it to the apps, build Gradle KTS file again under compose app build Gradle KTS, and here we go into Common Maine and we add Libs SQL light, coroutines extensions. At this point, we can simply Gradle sync…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.