Happy to share with you stateInUi, a handy little helper function for idiomatically turning Flow into StateFlow in view models. It is also a nice example of using Context Parameters.
To create Mono, Single or Maybe, use mono, rxSingle or rxMaybe that start a coroutine and emit its result. There is also rxCompletable that creates Completable from a coroutine.
For senior Kotlin developers, we recommend pairing the Kotlin Expert workshop with Advanced Kotlin, so participants can keep exploring advanced language features long after the training.
Reflection is a powerful tool that allows us to inspect classes and use their methods. To transform an object into a string, we can use reflection to get all properties and their values.
Creating a simple parser to JSON is one of the exercises we do on the Kotlin Expert workshop. If you want to attend it, there is an open edition in December. Feel invited, we will have a lot of fun.
Reflection is a powerful tool that allows us to inspect classes and use their methods. To transform an object into a string, we can use reflection to get all properties and their values.
Those are slides from my Kotlin Expert workshop; if you’d like to go deeper into topics like KSP, annotation processing, and compiler plugins, you can combine the workshop with my book Advanced Kotlin.
💎 Static dependency injection libraries are based on annotation processing or KSP. Both tools analyze our projects and, based on our classes, generate files that are included in the project. Consider the following structure. What could be generated for it?
💎 Some dependency injection libraries hide this injection even better. They might generate components and make our framework call them. This way we might not need to use any method like inject.