Remove more usages of Singleton

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2022-12-06 09:18:58 -05:00
1 parent 257082e699
commit 9fee31a872
18 files changed
+152 -129

No files matched your search

@@ -3,7 +3,8 @@
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { UserStore } from "../../common/user-store";
import userStoreInjectable from "../../common/user-store/user-store.injectable";
import { asLegacyGlobalForExtensionApi } from "../as-legacy-globals-for-extension-api/as-legacy-global-object-for-extension-api";
export interface UserPreferenceExtensionItems {
/**
* Get the configured kubectl binaries path.
@@ -11,6 +12,8 @@ export interface UserPreferenceExtensionItems {
getKubectlPath: () => string | undefined;
}
const userStore = asLegacyGlobalForExtensionApi(userStoreInjectable);
export const Preferences: UserPreferenceExtensionItems = {
getKubectlPath: () => UserStore.getInstance().kubectlBinariesPath,
getKubectlPath: () => userStore.kubectlBinariesPath,
};