-
-
Notifications
You must be signed in to change notification settings - Fork 426
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
[Suggestion] useScript #203
Comments
Hi @curtvict, What about a signature like this ? interface UseScriptOptions {
shouldLoad?: boolean
removeOnUnmount?: boolean
}
useScript(src: string, options?: UseScriptOptions): Status { ... } |
juliencrn
added a commit
that referenced
this issue
Sep 30, 2022
juliencrn
added a commit
that referenced
this issue
Oct 13, 2022
juliencrn
added a commit
that referenced
this issue
Oct 13, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm curious if the community would find this change to the call signature of
useScript
at all useful:shouldLoad
could be used for something, like, an environment or privacy flag:removeOnUnmount
could be used to remove the created script when the component callinguseScript
unmounts. Examples could be "one-shot" third party scripts that someone might just want to be present for a specific page of the app. Something like a HubSpot form that serves a specific use case, like Signing Up for an account.If these sound like good ideas I'm happy to open a PR making the aforementioned changes.
The text was updated successfully, but these errors were encountered: