You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we can emit values to our StateFlow variables by casting them to MutableStateFlow. We should update our StateFlow declarations to make them read-only
Solution
Update our StateFlow declarations as follows:
private val _uiModels = MutableStateFlow<List<UiModel>>(emptyList())
val uiModels = _uiModels.asStateFlow()
Apply updates to template-compose and sample-compose ViewModels
Who Benefits?
Developers
The text was updated successfully, but these errors were encountered:
Original RFC
Why
Currently we can emit values to our
StateFlow
variables by casting them toMutableStateFlow
. We should update ourStateFlow
declarations to make them read-onlySolution
StateFlow
declarations as follows:template-compose
andsample-compose
ViewModelsWho Benefits?
Developers
The text was updated successfully, but these errors were encountered: