-
-
Save GuilhE/a5650e358fc699665dc02e6b5ed2d8f7 to your computer and use it in GitHub Desktop.
Medium article - KMM
This file contains 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
static func createReservation() -> Future<Void, Error> { | |
return Future() { promise in | |
manager.createReservation() { data, error in | |
if let success = data as? ReservationsManagerReservationResultSuccess { | |
promise(Result.success(())) | |
} else if let error = data as? ReservationsManagerReservationResultError { | |
promise(Result.failure(error.toAppError())) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment