This repository was archived by the owner on Jul 16, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
detail/src/main/kotlin/io/goooler/demoapp/detail/vm
main/src/main/kotlin/io/goooler/demoapp/main/vm Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,10 +20,8 @@ class DetailViewModel : BaseViewModel() {
2020
2121 lateinit var fullName: String
2222
23- val repoDetailModel: StateFlow <RepoDetailModel >
24- get() = _repoDetailModel .asStateFlow()
25- val isRefreshing: StateFlow <Boolean >
26- get() = _isRefreshing .asStateFlow()
23+ val repoDetailModel: StateFlow <RepoDetailModel > = _repoDetailModel .asStateFlow()
24+ val isRefreshing: StateFlow <Boolean > = _isRefreshing .asStateFlow()
2725
2826 fun refresh () {
2927 viewModelScope.launch {
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import kotlinx.coroutines.async
1616import kotlinx.coroutines.delay
1717import kotlinx.coroutines.flow.MutableStateFlow
1818import kotlinx.coroutines.flow.StateFlow
19+ import kotlinx.coroutines.flow.asStateFlow
1920import kotlinx.coroutines.flow.flow
2021import kotlinx.coroutines.flow.flowOn
2122import kotlinx.coroutines.flow.onCompletion
@@ -26,7 +27,7 @@ class MainHomeViewModel : BaseViewModel() {
2627 private val repository = MainCommonRepository ()
2728
2829 private val _title = MutableStateFlow (" " )
29- val title: StateFlow <String > = _title
30+ val title: StateFlow <String > = _title .asStateFlow()
3031
3132 private var countdownJob: Job ? = null
3233
You can’t perform that action at this time.
0 commit comments