Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ export interface LoaderOptions {
* ```
*/
export class Loader {
private static instance: Loader;
/**
* See [[LoaderOptions.version]]
*/
Expand Down Expand Up @@ -244,7 +245,6 @@ export class Loader {
private done = false;
private loading = false;
private onerrorEvent: ErrorEvent;
private static instance: Loader;
private errors: ErrorEvent[] = [];

/**
Expand Down Expand Up @@ -363,6 +363,13 @@ export class Loader {
return url;
}

public deleteScript(): void {
const script = document.getElementById(this.id);
if (script) {
script.remove();
}
}

/**
* Load the Google Maps JavaScript API script and return a Promise.
*/
Expand Down Expand Up @@ -421,13 +428,6 @@ export class Loader {
document.head.appendChild(script);
}

public deleteScript(): void {
const script = document.getElementById(this.id);
if (script) {
script.remove();
}
}

/**
* Reset the loader state.
*/
Expand Down