Skip to content

Commit

Permalink
Refactor: Replace asLogicFlow with withFlow in TaskScreenModel
Browse files Browse the repository at this point in the history
Replaced `asLogicFlow` with `withFlow` in `TaskScreenModel
` for `uiState`, `getAllTaskList`, and `observeAllTasks`. This change likely updates the way state flows are handled within the screen model.
  • Loading branch information
youndon committed Jan 10, 2025
1 parent cdc989f commit ba50188
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ package city.zouitel.tasks.ui
import cafe.adriel.voyager.core.model.ScreenModel
import cafe.adriel.voyager.core.model.screenModelScope
import city.zouitel.domain.usecase.TaskUseCase
import city.zouitel.logic.asLogicFlow
import city.zouitel.logic.withFlow
import city.zouitel.logic.events.UiEvents
import city.zouitel.logic.events.UiEventsHandler
import city.zouitel.tasks.mapper.TaskMapper
@@ -26,10 +26,10 @@ class TaskScreenModel(
): ScreenModel, UiEventsHandler {

private val _uiState: MutableStateFlow<UiState> = MutableStateFlow(UiState())
val uiState: StateFlow<UiState> = _uiState.asLogicFlow(UiState())
val uiState: StateFlow<UiState> = _uiState.withFlow(UiState())

private val _getAllTaskList = MutableStateFlow<List<Task>>(emptyList())
val getAllTaskList: StateFlow<List<Task>> = _getAllTaskList.asLogicFlow(listOf())
val getAllTaskList: StateFlow<List<Task>> = _getAllTaskList.withFlow(listOf())

private val _observeAllTasks = MutableStateFlow<List<Task>>(emptyList())
val observeAllTasks: StateFlow<List<Task>> = _observeAllTasks
@@ -40,7 +40,7 @@ class TaskScreenModel(
}
}
}
.asLogicFlow(listOf())
.withFlow(listOf())

fun initializeTasks(uid: String) {
performUiEvent {

0 comments on commit ba50188

Please sign in to comment.