mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
- New name better implies that it is just a guard state and does not do anything Signed-off-by: Sebastian Malton <sebastian@malton.name>
25 lines
934 B
TypeScript
25 lines
934 B
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 { kubeObjectStoreInjectionToken } from "../../../common/k8s-api/api-manager/manager.injectable";
|
|
import nodeApiInjectable from "../../../common/k8s-api/endpoints/node.api.injectable";
|
|
import storesAndApisCanBeCreatedInjectable from "../../stores-apis-can-be-created.injectable";
|
|
import { NodeStore } from "./store";
|
|
|
|
const nodeStoreInjectable = getInjectable({
|
|
id: "node-store",
|
|
instantiate: (di) => {
|
|
assert(di.inject(storesAndApisCanBeCreatedInjectable), "nodeStore is only available in certain environments");
|
|
|
|
const api = di.inject(nodeApiInjectable);
|
|
|
|
return new NodeStore(api);
|
|
},
|
|
injectionToken: kubeObjectStoreInjectionToken,
|
|
});
|
|
|
|
export default nodeStoreInjectable;
|