Skip to content

Commit

Permalink
expose clear persistence function
Browse files Browse the repository at this point in the history
  • Loading branch information
sherryshao committed Mar 15, 2024
1 parent 9d2f39a commit 8656a07
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Sources/FirebaseFirestore/Firestore+Swift.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ public class Firestore {
}
}

public func clearPersistence(completion: @escaping () -> Void) {
let future = swift_firebase.swift_cxx_shims.firebase.firestore.firestore_clear_persistence(self)
future.setCompletion(completion)
}

public func document(_ documentPath: String) -> DocumentReference {
swift_firebase.swift_cxx_shims.firebase.firestore.firestore_document(impl, std.string(documentPath))
}
Expand Down
5 changes: 5 additions & 0 deletions Sources/firebase/include/FirebaseFirestore.hh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ firestore_set_settings(::firebase::firestore::Firestore *firestore, ::firebase::
return firestore->set_settings(settings);
}

inline VoidFuture
firestore_clear_persistence(::firebase::firestore::Firestore *firestore) {
return VoidFuture::From(firestore->ClearPersistence());
}

inline ::firebase::firestore::DocumentReference
firestore_document(::firebase::firestore::Firestore *firestore,
const ::std::string &document_path) {
Expand Down

0 comments on commit 8656a07

Please sign in to comment.