Skip to content

PurchasesOrchestrator.purchase(sk2Product:promotionalOffer:): simplified implementation with new operator#1602

Merged
NachoSoto merged 2 commits into
mainfrom
purchases-orchestrator-single-return
May 26, 2022
Merged

PurchasesOrchestrator.purchase(sk2Product:promotionalOffer:): simplified implementation with new operator#1602
NachoSoto merged 2 commits into
mainfrom
purchases-orchestrator-single-return

Conversation

@NachoSoto

Copy link
Copy Markdown
Contributor

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.

@NachoSoto NachoSoto requested a review from a team May 24, 2022 02:23
@NachoSoto NachoSoto force-pushed the purchases-orchestrator-single-return branch 2 times, most recently from cc5dd82 to 11cadb9 Compare May 24, 2022 03:06
Comment thread Sources/FoundationExtensions/Operators+Extensions.swift Outdated
Comment thread Sources/FoundationExtensions/Operators+Extensions.swift Outdated
Comment on lines 359 to 367

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is cool

NachoSoto added 2 commits May 26, 2022 14:56
…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.
@NachoSoto NachoSoto force-pushed the purchases-orchestrator-single-return branch from 11cadb9 to 25e3c6a Compare May 26, 2022 21:58
@NachoSoto NachoSoto merged commit 7bb76a3 into main May 26, 2022
@NachoSoto NachoSoto deleted the purchases-orchestrator-single-return branch May 26, 2022 21:58
@NachoSoto NachoSoto mentioned this pull request Jun 2, 2022
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)
@aboedo aboedo mentioned this pull request Jun 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants