mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
28 lines
963 B
TypeScript
28 lines
963 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 podApiInjectable from "../../../common/k8s-api/endpoints/pod.api.injectable";
|
|
import createStoresAndApisInjectable from "../../create-stores-apis.injectable";
|
|
import apiManagerInjectable from "../../../common/k8s-api/api-manager/manager.injectable";
|
|
import { PodStore } from "./store";
|
|
|
|
const podStoreInjectable = getInjectable({
|
|
id: "pod-store",
|
|
instantiate: (di) => {
|
|
assert(di.inject(createStoresAndApisInjectable), "podStore is only available in certain environements");
|
|
|
|
const api = di.inject(podApiInjectable);
|
|
const apiManager = di.inject(apiManagerInjectable);
|
|
const store = new PodStore(api);
|
|
|
|
apiManager.registerStore(store);
|
|
|
|
return store;
|
|
},
|
|
});
|
|
|
|
export default podStoreInjectable;
|