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

Feature request: injectScriptOnce #8

Open
bantic opened this issue Sep 6, 2017 · 1 comment
Open

Feature request: injectScriptOnce #8

bantic opened this issue Sep 6, 2017 · 1 comment

Comments

@bantic
Copy link

bantic commented Sep 6, 2017

A pattern we commonly use is to use a utility function to inject a script (for example, the filestack SDK) and keep a reference to the promise, returning it for subsequent calls so that multiple script elements don't get added to the page.

Would you be interested in a PR that adds an injectScriptOnce function that uses a map to keep track of which URLs have already been injected, and return their existing promise instead of creating a new <script> tag?

@rlivsey
Copy link
Member

rlivsey commented Sep 6, 2017

Sounds good to me 👍

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

No branches or pull requests

2 participants