mirror of
https://github.com/yattee/yattee.git
synced 2024-11-09 15:58:20 +00:00
parent
f0d581d512
commit
13382270d5
@ -20,16 +20,10 @@ final class Store<Data>: ResourceObserver, ObservableObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func replace(_ items: Data) {
|
func replace(_ items: Data) {
|
||||||
// Ensure the change happens on the main thread
|
all = items
|
||||||
DispatchQueue.main.async {
|
|
||||||
self.all = items
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func clear() {
|
func clear() {
|
||||||
// Ensure clearing happens on the main thread
|
all = nil
|
||||||
DispatchQueue.main.async {
|
|
||||||
self.all = nil
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user