wip
This commit is contained in:
@@ -12,6 +12,7 @@ class LookupsManager: ObservableObject {
|
||||
@Published var taskFrequencies: [TaskFrequency] = []
|
||||
@Published var taskPriorities: [TaskPriority] = []
|
||||
@Published var taskStatuses: [TaskStatus] = []
|
||||
@Published var allTasks: [CustomTask] = []
|
||||
@Published var isLoading: Bool = false
|
||||
@Published var isInitialized: Bool = false
|
||||
|
||||
@@ -58,6 +59,13 @@ class LookupsManager: ObservableObject {
|
||||
}
|
||||
}
|
||||
|
||||
// Observe all tasks
|
||||
Task {
|
||||
for await tasks in repository.allTasks.taskTaskAsyncSequence {
|
||||
self.allTasks = tasks
|
||||
}
|
||||
}
|
||||
|
||||
// Observe loading state
|
||||
Task {
|
||||
for await loading in repository.isLoading.boolAsyncSequence {
|
||||
|
||||
@@ -65,7 +65,11 @@ extension Kotlinx_coroutines_coreStateFlow {
|
||||
return asAsyncSequence()
|
||||
}
|
||||
|
||||
var taskTaskAsyncSequence: AsyncStream<[CustomTask]> {
|
||||
return asAsyncSequence()
|
||||
}
|
||||
|
||||
var boolAsyncSequence: AsyncStream<Bool> {
|
||||
return asAsyncSequence()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user