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

Cache token provider callback between re-renders. #520

Merged
merged 1 commit into from
Aug 11, 2023

Conversation

chr-stripe
Copy link
Contributor

Summary

Prevent instantiating a new fetchTokenProvider function on each render pass.

Motivation

Prevents the dev/example apps from reinitializing the Terminal SDK
more than once when unnecessary.

Testing

  • I tested this manually
  • I added automated tests

Documentation

Select one:

  • I have added relevant documentation for my changes.
  • This PR does not result in any developer-facing changes.

@chr-stripe chr-stripe force-pushed the chr/memoize-tokenprovider branch from 927c0d9 to baf8771 Compare August 11, 2023 04:24
if (!api) {
console.log('hi hi hi');
Copy link
Collaborator

Choose a reason for hiding this comment

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

🤦‍♀️

@nazli-stripe nazli-stripe merged commit 1870117 into main Aug 11, 2023
@chr-stripe chr-stripe deleted the chr/memoize-tokenprovider branch August 11, 2023 18:05
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