mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
28 lines
1.1 KiB
TypeScript
28 lines
1.1 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 clusterRoleBindingApiInjectable from "../../../../common/k8s-api/endpoints/cluster-role-binding.api.injectable";
|
|
import apiManagerInjectable from "../../../../common/k8s-api/api-manager/manager.injectable";
|
|
import { ClusterRoleBindingStore } from "./store";
|
|
|
|
const clusterRoleBindingStoreInjectable = getInjectable({
|
|
id: "cluster-role-binding-store",
|
|
instantiate: (di) => {
|
|
assert(di.inject(createStoresAndApisInjectionToken), "clusterRoleBindingStore is only accessible in certain environments");
|
|
|
|
const api = di.inject(clusterRoleBindingApiInjectable);
|
|
const apiManager = di.inject(apiManagerInjectable);
|
|
const store = new ClusterRoleBindingStore(api);
|
|
|
|
apiManager.registerStore(store);
|
|
|
|
return store;
|
|
},
|
|
});
|
|
|
|
export default clusterRoleBindingStoreInjectable;
|