chore: Extract an injectionToken

Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
This commit is contained in:
Iku-turso authored and Sebastian Malton committed 2023-04-25 17:38:02 -04:00
1 parent 0dae1594ba
commit db9a3675e1
7 files changed
+19 -14

No files matched your search

@@ -12,7 +12,7 @@ import { DiContextProvider } from "@ogre-tools/injectable-react";
import { Router } from "react-router";
import { DefaultProps } from "../../mui-base-theme";
import { ClusterFrame } from "./cluster-frame";
import { historyInjectable } from "@k8slens/routing";
import { historyInjectionToken } from "@k8slens/routing";
import { computed } from "mobx";
import { Cluster } from "../../../common/cluster/cluster";
import subscribeStoresInjectable from "../../kube-watch-api/subscribe-stores.injectable";
@@ -34,7 +34,7 @@ describe("<ClusterFrame />", () => {
di = getDiForUnitTesting();
render = () => testingLibraryRender((
<DiContextProvider value={{ di }}>
<Router history={di.inject(historyInjectable)}>
<Router history={di.inject(historyInjectionToken)}>
{DefaultProps(ClusterFrame)}
</Router>
</DiContextProvider>
@@ -4,7 +4,7 @@
*/
import { getInjectable } from "@ogre-tools/injectable";
import { Router } from "react-router";
import { historyInjectable } from "@k8slens/routing";
import { historyInjectionToken } from "@k8slens/routing";
import React from "react";
import {
@@ -15,7 +15,7 @@ const routingReactApplicationHocInjectable = getInjectable({
id: "routing-react-application-hoc",
instantiate: (di) => {
const history = di.inject(historyInjectable);
const history = di.inject(historyInjectionToken);
return ({ children }) =>
(