Compose beyond the UI: Molecule at Swedish Railways | Erik Westenius

Published: 13 August 2024
on channel: Kotlin by JetBrains
5,707
187

Recording brought to you by American Express. https://americanexpress.io/kotlin-jobs

With the advent of Jetpack Compose UI, it has become easier than ever to create elegant, dynamic user interfaces for our applications. However, Jetpack Compose's capabilities extend beyond UI creation. This talk aims to show how you can harness the power of Jetpack Compose for other parts of your applications using a framework called Molecule. Molecule is a framework that lets you build Flow streams using Jetpack Compose. This may not sound like much but it opens up a whole new frontier for using Jetpack Compose.

In this talk we will explore our learnings of using Molecule in a major refactoring of the Swedish Railways (SJ) app during the past year.

We will start off with an introduction to molecule and then move on to exploring how we can leverage Jetpack Compose and Molecule in our presentation layers. This part will show how to combine multiple reactive streams in a manner that is more maintainable and easier to test than the common flow combine function. We will also explore using LaunchedEffect for side effects and periodic updates using real world scenarios. We will end this section by discussing gotchas related to handling hot flows.

Next, we will push the boundaries and test the limits of Molecule by trying to rewrite a repository. Can you represent a network request by a composable? How would you handle errors and retries? How do you share data between Molecule flows? This talk will be concluded by discussing some architectural pitfalls we stumbled upon during our adventures.

#kotlinconf #kotlin


Watch video Compose beyond the UI: Molecule at Swedish Railways | Erik Westenius online, duration hours minute second in high quality that is uploaded to the channel Kotlin by JetBrains 13 August 2024. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 5,707 times and liked it 187 visitors.