Skip to content

Commit

Permalink
destroy config
Browse files Browse the repository at this point in the history
  • Loading branch information
jpinkney-aws committed Dec 13, 2024
1 parent 3e392ae commit 597d9ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/helper/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const configDefaults: ConfigFullModel = {
},
};
export class Config {
private static instance: Config;
private static instance: Config | undefined;
public config: ConfigFullModel;
private constructor (config?: Partial<ConfigModel>) {
this.config = {
Expand Down Expand Up @@ -127,4 +127,8 @@ export class Config {

return Config.instance;
}

public destroy = (): void => {
Config.instance = undefined;
};
}
1 change: 1 addition & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,7 @@ ${(item.task ? marked.parseInline : marked.parse)(item.text, { breaks: false })
};

public destroy = (): void => {
Config.getInstance().destroy();
MynahUITabsStore.getInstance().destroy();
MynahUIGlobalEvents.getInstance().destroy();
DomBuilder.getInstance().destroy();
Expand Down

0 comments on commit 597d9ef

Please sign in to comment.