Skip to content

Commit

Permalink
[#535] Update state flow to use asStateFlow
Browse files Browse the repository at this point in the history
  • Loading branch information
kaungkhantsoe committed Oct 19, 2023
1 parent ce05d6b commit f78d181
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ class HomeViewModel @Inject constructor(
) : BaseViewModel() {

private val _uiModels = MutableStateFlow<List<UiModel>>(emptyList())
val uiModels: StateFlow<List<UiModel>> = _uiModels
val uiModels = _uiModels.asStateFlow()

private val _isFirstTimeLaunch = MutableStateFlow(false)
val isFirstTimeLaunch: StateFlow<Boolean> = _isFirstTimeLaunch
val isFirstTimeLaunch = _isFirstTimeLaunch.asStateFlow()

init {
getModelsUseCase()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class HomeViewModel @Inject constructor(
) : BaseViewModel() {

private val _uiModels = MutableStateFlow<List<UiModel>>(emptyList())
val uiModels: StateFlow<List<UiModel>> = _uiModels
val uiModels = _uiModels.asStateFlow()

init {
useCase()
Expand Down

0 comments on commit f78d181

Please sign in to comment.