From cf052b907062361391b13a5006fe734861df4ef7 Mon Sep 17 00:00:00 2001 From: Janne Savolainen Date: Wed, 13 Apr 2022 10:23:31 +0300 Subject: [PATCH] Deprecate some globals Co-authored-by: Mikko Aspiala Signed-off-by: Janne Savolainen --- .../catalog-category-registry.injectable.ts | 14 ++++++++++++++ src/common/catalog/catalog-category-registry.ts | 3 +++ src/main/catalog/catalog-entity-registry.ts | 3 +++ 3 files changed, 20 insertions(+) create mode 100644 src/common/catalog/catalog-category-registry.injectable.ts diff --git a/src/common/catalog/catalog-category-registry.injectable.ts b/src/common/catalog/catalog-category-registry.injectable.ts new file mode 100644 index 0000000000..5bf320aaa6 --- /dev/null +++ b/src/common/catalog/catalog-category-registry.injectable.ts @@ -0,0 +1,14 @@ +/** + * Copyright (c) OpenLens Authors. All rights reserved. + * Licensed under MIT License. See LICENSE in root directory for more information. + */ +import { getInjectable } from "@ogre-tools/injectable"; +import { catalogCategoryRegistry } from "./catalog-category-registry"; + +const catalogCategoryRegistryInjectable = getInjectable({ + id: "catalog-category-registry", + instantiate: () => catalogCategoryRegistry, + causesSideEffects: true, +}); + +export default catalogCategoryRegistryInjectable; diff --git a/src/common/catalog/catalog-category-registry.ts b/src/common/catalog/catalog-category-registry.ts index 7eb3e0fac8..2bb81ae68e 100644 --- a/src/common/catalog/catalog-category-registry.ts +++ b/src/common/catalog/catalog-category-registry.ts @@ -95,4 +95,7 @@ export class CatalogCategoryRegistry { } } +/** + * @deprecated Switch to using catalogCategoryRegistryInjectable + */ export const catalogCategoryRegistry = new CatalogCategoryRegistry(); diff --git a/src/main/catalog/catalog-entity-registry.ts b/src/main/catalog/catalog-entity-registry.ts index fa633e093c..30c4f37781 100644 --- a/src/main/catalog/catalog-entity-registry.ts +++ b/src/main/catalog/catalog-entity-registry.ts @@ -49,4 +49,7 @@ export class CatalogEntityRegistry { } } +/** + * @deprecated Switch to using catalogEntityRegistryInjectable + */ export const catalogEntityRegistry = new CatalogEntityRegistry(catalogCategoryRegistry);