Hi Thomas! Thanks for pointing this out.
I had added the lazy keyword later.
I just realized it's not possible to specify the "lazy" keyword on the class constructor parameters, but only on the standard properties.
However in case of data classes, we need to specify the fields as constructor parameters, otherwise we are not able to use the data class "copy" function.
So, I updated the article, removing the lazy keyword.
In terms of objects instantiation, you can decide when it's more convenient. In case of a small app, you can easily instantiate all screen state objects directly in the AppState definition:
data class AppState (
val homeScreen = HomeData(),
val listScreen = ListData(),
val detailScreen = DetailData(),
In case of apps with many screens, you can decide to default most of them to null.