jw
06/16/2021, 2:28 AMval models = flow {
val db = initDb() // <-- suspending lazy init pattern
emitAll(db.whatever.models())
}
which hides the async initialization behind the first caller and also isolates your db as an implementation detail of the data layer