mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-02-09 08:39:00 +01:00
Convert Account.update(feed, parsedFeed) to async await.
This commit is contained in:
parent
69fd496576
commit
c45c6eff0e
@ -826,6 +826,21 @@ public enum FetchType {
|
||||
}
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
func update(_ feed: Feed, with parsedFeed: ParsedFeed) async throws -> ArticleChanges {
|
||||
|
||||
try await withCheckedThrowingContinuation { continuation in
|
||||
self.update(feed, with: parsedFeed) { result in
|
||||
switch result {
|
||||
case .success(let articleChanges):
|
||||
continuation.resume(returning: articleChanges)
|
||||
case .failure(let error):
|
||||
continuation.resume(throwing: error)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func update(_ feed: Feed, with parsedFeed: ParsedFeed, _ completion: @escaping UpdateArticlesCompletionBlock) {
|
||||
// Used only by an On My Mac or iCloud account.
|
||||
precondition(Thread.isMainThread)
|
||||
|
Loading…
x
Reference in New Issue
Block a user