{ showProgress() val id = 10L val profile = dataSource.loadProfile(id) val articles = dataSource.loadArticles(id) showContent(profile, articles) hideProgress() } }
lifecylceScope Activity Fragment lifecycle-runtime-ktx:2.2.0-alpha01 or higher viewModelScope lifecycle-viewmodel-ktx:2.1.0-beta01 or higher LiveData liveData lifecycle-livedata-ktx:2.2.0-alpha01 or higher
lifecylceScope Activity Fragment lifecycle-runtime-ktx:2.2.0-alpha01 or higher viewModelScope lifecycle-viewmodel-ktx:2.1.0-beta01 or higher LiveData liveData lifecycle-livedata-ktx:2.2.0-alpha01 or higher 幸いなことにKotlinコルーチンのサポートが 様々なプラットフォームで進んでおり、⾃前で ⽤意する必要はほとんどなくなった