Refactor getInstance() methods

This commit is contained in:
redphx
2024-10-14 16:56:05 +07:00
parent 9f440e9cf4
commit 927eae3f2f
12 changed files with 14 additions and 82 deletions

View File

@@ -3,13 +3,7 @@ import { STATES } from "./global";
export class XcloudApi {
private static instance: XcloudApi;
public static getInstance(): XcloudApi {
if (!XcloudApi.instance) {
XcloudApi.instance = new XcloudApi();
}
return XcloudApi.instance;
}
public static getInstance = () => XcloudApi.instance ?? (XcloudApi.instance = new XcloudApi());
private CACHE_TITLES: {[key: string]: XcloudTitleInfo} = {};
private CACHE_WAIT_TIME: {[key: string]: XcloudWaitTimeInfo} = {};