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 alternative side-effect free import path #45

Merged
merged 3 commits into from
Apr 16, 2020

Conversation

christopher-stripe
Copy link
Contributor

Summary & motivation

Adds an alternative path for importing loadStripe, which delays loading the Stripe.js script until loadStripe is called:

import {loadStripe} from '@stripe/stripe-js/pure';

Testing & documentation

  • Added 2 tests for the side-effect in pure.test.ts
  • Configured the loadStripe tests to run against both the default module and pure module
  • Added section to README documenting the import path
  • Tested manually with a create-react-app app

Copy link
Contributor

@hofman-stripe hofman-stripe left a comment

Choose a reason for hiding this comment

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

Looks good, just some small nits

src/shared.ts Outdated Show resolved Hide resolved
src/shared.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@hofman-stripe hofman-stripe left a comment

Choose a reason for hiding this comment

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

Couple issues with the tests I had missed originally.

src/pure.test.ts Outdated Show resolved Hide resolved
src/pure.test.ts Show resolved Hide resolved
@christopher-stripe christopher-stripe merged commit 2a28dec into master Apr 16, 2020
@christopher-stripe christopher-stripe deleted the christopher/pure branch April 16, 2020 17:29
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