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
According to the problem in the recent projects to handle multiple complex UI state logic, such as skeleton loading with partial loading or separate/multiple error handling between data flows, we had revamped the UiState handling from the ViewModel to adapt and cover these cases. It's time to bring that new approach to replace the existing deprecated approach injectLoading from the base template.
Define the base UiState for data flow execution states.
Define the base uiState StateFlow<HashMap<Int, UiState>> in BaseViewModel to handle separate UiState for each data flow. This helps avoid defining many states for all data flows in a ViewModel.
Sync all UiState with isLoading StateFlow to handle the "global loading state".
Who Benefits?
Developers
The text was updated successfully, but these errors were encountered:
Why
According to the problem in the recent projects to handle multiple complex UI state logic, such as skeleton loading with partial loading or separate/multiple error handling between data flows, we had revamped the UiState handling from the ViewModel to adapt and cover these cases. It's time to bring that new approach to replace the existing deprecated approach
injectLoading
from the base template.android-templates/template-compose/app/src/main/java/co/nimblehq/template/compose/ui/base/BaseViewModel.kt
Lines 24 to 51 in dc5d66c
What we will do:
UiState
for data flow execution states.uiState
StateFlow<HashMap<Int, UiState>> inBaseViewModel
to handle separate UiState for each data flow. This helps avoid defining many states for all data flows in a ViewModel.UiState
withisLoading
StateFlow to handle the "global loading state".Who Benefits?
Developers
The text was updated successfully, but these errors were encountered: