Skip to content

Commit

Permalink
docs: purchases.md use object instead of params in requestSubscriptio…
Browse files Browse the repository at this point in the history
…n call (#2459)

The example shown in purchases.md has the wrong interface use for the
function `requestSubscription`

In the docs example is shown as
```typescript
      await requestSubscription(
        {sku},
        ...(offerToken && {subscriptionOffers: [{sku, offerToken}]}),
      );
```

While the interface to the function requires an object of the type
`RequestSubscription` and not 2 args
  • Loading branch information
frothAml authored Jun 22, 2023
1 parent 9ca0210 commit 910ef24
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/docs/guides/purchases.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ class App extends Component {

subscribe = async (sku: string, offerToken: string?) => {
try {
await requestSubscription(
{sku},
await requestSubscription({
sku,
...(offerToken && {subscriptionOffers: [{sku, offerToken}]}),
);
});
} catch (err) {
console.warn(err.code, err.message);
}
Expand Down

0 comments on commit 910ef24

Please sign in to comment.