Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixup the signatures of clearPersistence and terminate #53

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Sources/FirebaseFirestore/Firestore+Swift.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@ public class Firestore {
}
}

public func clearPersistence(completion: (() -> Void)?) {
public func clearPersistence(completion: ((Error?) -> Void)?) {
let future = swift_firebase.swift_cxx_shims.firebase.firestore.firestore_clear_persistence(impl)
future.setCompletion({
if let completion {
DispatchQueue.main.async {
completion()
completion(nil)
}
}
})
}

public func clearPersistence() async {
public func clearPersistence() async throws {
await withCheckedContinuation { continuation in
let future = swift_firebase.swift_cxx_shims.firebase.firestore.firestore_clear_persistence(impl)
future.setCompletion({
Expand All @@ -64,18 +64,18 @@ public class Firestore {
}
}

public func terminate(completion: (() -> Void)?) {
public func terminate(completion: ((Error?) -> Void)?) {
let future = swift_firebase.swift_cxx_shims.firebase.firestore.firestore_terminate(impl)
future.setCompletion({
if let completion {
DispatchQueue.main.async {
completion()
completion(nil)
}
}
})
}

public func terminate() async {
public func terminate() async throws {
await withCheckedContinuation { continuation in
let future = swift_firebase.swift_cxx_shims.firebase.firestore.firestore_terminate(impl)
future.setCompletion({
Expand Down
Loading