mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Allow asynchronous instances in injectable typing
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
1 parent
0c0dfe5966
commit
c9503c1d14
5 files changed
+31
-24
No files matched your search
@@ -52,7 +52,7 @@ import { AppPaths } from "../common/app-paths";
|
||||
import { registerCustomThemes } from "./components/monaco-editor";
|
||||
import { getDi } from "./components/getDi";
|
||||
import { DiContextProvider } from "@ogre-tools/injectable-react";
|
||||
import type { IDependencyInjectionContainer } from "@ogre-tools/injectable";
|
||||
import type { DependencyInjectionContainer } from "@ogre-tools/injectable";
|
||||
|
||||
if (process.isMainFrame) {
|
||||
SentryInit();
|
||||
@@ -76,7 +76,7 @@ type AppComponent = React.ComponentType & {
|
||||
init(rootElem: HTMLElement): Promise<void>;
|
||||
};
|
||||
|
||||
export async function bootstrap(comp: () => Promise<AppComponent>, di: IDependencyInjectionContainer) {
|
||||
export async function bootstrap(comp: () => Promise<AppComponent>, di: DependencyInjectionContainer) {
|
||||
const rootElem = document.getElementById("app");
|
||||
const logPrefix = `[BOOTSTRAP-${process.isMainFrame ? "ROOT" : "CLUSTER"}-FRAME]:`;
|
||||
|
||||
|
||||
@@ -20,10 +20,10 @@
|
||||
*/
|
||||
|
||||
import { createContainer } from "@ogre-tools/injectable";
|
||||
import type { IConfigurableDependencyInjectionContainer } from "@ogre-tools/injectable";
|
||||
import type { ConfigurableDependencyInjectionContainer } from "@ogre-tools/injectable";
|
||||
|
||||
export const getDi = () => {
|
||||
const di: IConfigurableDependencyInjectionContainer = createContainer(
|
||||
const di: ConfigurableDependencyInjectionContainer = createContainer(
|
||||
() => require.context("./", true, /\.injectable\.(ts|tsx)$/),
|
||||
);
|
||||
|
||||
|
||||
@@ -24,11 +24,11 @@ import { memoize } from "lodash/fp";
|
||||
|
||||
import {
|
||||
createContainer,
|
||||
IConfigurableDependencyInjectionContainer,
|
||||
ConfigurableDependencyInjectionContainer,
|
||||
} from "@ogre-tools/injectable";
|
||||
|
||||
export const getDiForUnitTesting = () => {
|
||||
const di: IConfigurableDependencyInjectionContainer = createContainer();
|
||||
const di: ConfigurableDependencyInjectionContainer = createContainer();
|
||||
|
||||
getInjectableFilePaths()
|
||||
.map(key => {
|
||||
|
||||
Reference in new issue
Block a user