PurchasesOrchestrator.purchase(sk2Product:promotionalOffer:): simplified implementation with new operator#1602
Merged
Conversation
cc5dd82 to
11cadb9
Compare
NachoSoto
commented
May 24, 2022
aboedo
approved these changes
May 26, 2022
Comment on lines
359
to
367
…ified implementation with new operator Both `return` statements where the same, the `else` was just providing a default value to `customerInfoIfSynced`. Because `??` doesn't support an `async` function, we couldn't use that. By using this new operator we can simplify the implementation to a single `return` statement.
11cadb9 to
25e3c6a
Compare
Merged
NachoSoto
added a commit
that referenced
this pull request
Jun 2, 2022
### New Features * `Purchases.customerInfo()`: added overload with a new `CacheFetchPolicy` (#1608) via NachoSoto (@NachoSoto) * `Storefront`: added `sk1CurrentStorefront` for Objective-C (#1614) via NachoSoto (@NachoSoto) ### Bug Fixes * Fix for not being able to read receipts on watchOS (#1625) via Patrick Busch (@patrickbusch) ### Other Changes * Added tests for `PurchasesOrchestrator` invoking `listenForTransactions` only if SK2 is enabled (#1618) via NachoSoto (@NachoSoto) * `PurchasesOrchestrator`: removed `lazy` hack for properties with `@available` (#1596) via NachoSoto (@NachoSoto) * `PurchasesOrchestrator.purchase(sk2Product:promotionalOffer:)`: simplified implementation with new operator (#1602) via NachoSoto (@NachoSoto)
Closed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Both
returnstatements where the same, theelsewas just providing a default value tocustomerInfoIfSynced.Because
??doesn't support anasyncfunction, we couldn't use that. By using this new operator we can simplify the implementation to a singlereturnstatement.