|
|
|
|
@ -27,6 +27,13 @@ public class StoredSingleton<T: SyncedStorable>: SyncedCollection<T> { |
|
|
|
|
return self.items.first |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public func tryPutBeforeUpdating(_ instance: T) async throws { |
|
|
|
|
if let result = try await StoreCenter.main.service().put(instance) { |
|
|
|
|
self.setItemNoSync(result) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// MARK: - Protects from use |
|
|
|
|
|
|
|
|
|
public override func addOrUpdate(contentOfs sequence: any Sequence<T>) { |
|
|
|
|
|