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

Instantiates img and canvas only once #26

Merged
merged 1 commit into from
Jul 18, 2020

Conversation

ericnograles
Copy link
Owner

@ericnograles ericnograles commented Jul 18, 2020

Summary

Everytime the function is called, it creates a new img and canvas tag; this can lead to performance issues on UI's of scale. (See #18)

Fix Details

  • img and canvas are now hoisted in the module
  • Two supporting functions to get or create said elements are now in place
  • Swapped out var with let's for cleanliness

@ericnograles ericnograles merged commit 78df9a1 into master Jul 18, 2020
@ericnograles ericnograles deleted the single-use-img-and-canvas branch September 25, 2022 18:07
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.

1 participant