blob: 1cd4dffc555883a35fb02b75828e951c8dd3469e [file]
export const loadScript = (src: string, container: HTMLElement | null) => {
const script = document.createElement('script');
script.setAttribute('async', '');
script.src = src;
container && container.appendChild(script);
return script;
};
export const removeScript = (
script: HTMLScriptElement | HTMLElement,
container: HTMLElement | null
) => {
if (script.parentNode != container) return;
container && container?.removeChild(script);
};