1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/src/renderer/components/+user-management/+cluster-roles/store.injectable.ts
Sebastian Malton 24db61fbef fix deployments.store.test.ts
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2022-05-04 08:47:18 -04:00

28 lines
1.0 KiB
TypeScript

/**
* 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 assert from "assert";
import { createStoresAndApisInjectionToken } from "../../../../common/k8s-api/create-stores-apis.token";
import clusterRoleApiInjectable from "../../../../common/k8s-api/endpoints/cluster-role.api.injectable";
import apiManagerInjectable from "../../../../common/k8s-api/api-manager/manager.injectable";
import { ClusterRolesStore } from "./store";
const clusterRoleStoreInjectable = getInjectable({
id: "cluster-role-store",
instantiate: (di) => {
assert(di.inject(createStoresAndApisInjectionToken), "clusterRoleStore is only available in certain environments");
const api = di.inject(clusterRoleApiInjectable);
const apiManager = di.inject(apiManagerInjectable);
const store = new ClusterRolesStore(api);
apiManager.registerStore(store);
return store;
},
});
export default clusterRoleStoreInjectable;