Skip to content

Commit

Permalink
refactor: 리턴타입 지정 및 onload 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
cruelladevil committed Nov 11, 2024
1 parent b335085 commit 5647dcf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/src/shared/utils/loadScript.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const loadScript = (source: string) => {
export const loadScript = (source: string): Promise<void> => {
const element = document.querySelector(`script[src="${source}"]`);

if (element) {
Expand All @@ -11,7 +11,7 @@ export const loadScript = (source: string) => {
script.async = true;
script.defer = true;
script.src = source;
script.onload = resolve;
script.onload = () => resolve();

document.body.appendChild(script);
});
Expand Down

0 comments on commit 5647dcf

Please sign in to comment.