1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

remove iter use from getLegacyGlobalDiForExtensionApi

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2022-05-05 08:49:10 -04:00
parent f71f9e9f8f
commit 2a8ca21fc9

View File

@ -3,7 +3,6 @@
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import type { DiContainer } from "@ogre-tools/injectable"; import type { DiContainer } from "@ogre-tools/injectable";
import { iter } from "../../common/utils";
const legacyGlobalDis = new Map<Environments, DiContainer>(); const legacyGlobalDis = new Map<Environments, DiContainer>();
@ -24,7 +23,7 @@ export const getLegacyGlobalDiForExtensionApi = () => {
throw new Error("Tried to get DI container using legacy globals where there is multiple containers available."); throw new Error("Tried to get DI container using legacy globals where there is multiple containers available.");
} }
const di = iter.first(legacyGlobalDis.values()); const [di] = [...legacyGlobalDis.values()];
if (!di) { if (!di) {
throw new Error("Tried to get DI container using legacy globals where there is no containers available."); throw new Error("Tried to get DI container using legacy globals where there is no containers available.");