Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CheckoutResponse interfaces #23

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open

Conversation

stevehenty
Copy link
Contributor

This PR adds the CheckoutResponse interfaces.

@stevehenty stevehenty requested a review from swashata December 4, 2024 15:49
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please revert the changes. They are redundant, because we aren't really using those parameters.

CleanShot 2024-12-05 at 17 17 33@2x

src/demo.ts Outdated
@@ -65,13 +66,13 @@ document.addEventListener('DOMContentLoaded', () => {
cancel() {
log('cancel');
},
purchaseCompleted(data) {
purchaseCompleted(data: CheckoutResponse | null) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since you've already properly added the type to the main interface, TypeScript now properly infers it and that's the DX we want indeed.

CleanShot 2024-12-05 at 17 18 17@2x

CleanShot 2024-12-05 at 17 19 10@2x

So I would suggest to rever these changes too.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice

@stevehenty stevehenty requested a review from swashata December 5, 2024 17:19
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