Created
September 29, 2020 00:27
-
-
Save ericlewis/1cbab5eb2a52b43f72f308d362bdd8d4 to your computer and use it in GitHub Desktop.
lazy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension DatabaseReference { | |
| func observeSingleEventPublisher(of eventType: DataEventType) -> AnyPublisher<DataSnapshot, Error> { | |
| Future<DataSnapshot, Error> { [weak self] completion in | |
| self?.observeSingleEvent(of: eventType) { | |
| completion(.success($0)) | |
| } | |
| } | |
| .eraseToAnyPublisher() | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment