Transitioning to Unified State Management: Refactoring a Daynote ViewModel and Screen | by Murat Gunay | Dec, 2024

class ViewDaynoteViewModel : ViewModel() {private val _uiState = MutableStateFlow<ViewDaynoteUiState>(ViewDaynoteUiState.Loading)val uiState: StateFlow<ViewDaynoteUiState> = _uiState var commentText = MutableStateFlow(“”) fun loadDaynote(daynoteId: String) {viewModelScope.launch {_uiState.value = ViewDaynoteUiState.Loadingval result = daynoteRepository.getDaynoteById(daynoteId).flatMap { daynote ->userRepository.getUserPreviewById(daynote.userId).map …

Transitioning to Unified State Management: Refactoring a Daynote ViewModel and Screen | by Murat Gunay | Dec, 2024 Read More

Building a State Management Wrapper for Android Using Koin, and Jetpack Compose | by Ruslan Gaivoronskii | Nov, 2024

In this article, I describe StateWrapper — a solution for state management in Android applications. StateWrapper allows handling different states such as data loading, successful operation completion, and errors, with …

Building a State Management Wrapper for Android Using Koin, and Jetpack Compose | by Ruslan Gaivoronskii | Nov, 2024 Read More