mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Full dependency inversion of <Dock> and all current tab kinds (#4757)
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Co-authored-by: Sebastian Malton <sebastian@malton.name> Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
152 files changed
+3423
-2617
No files matched your search
@@ -4,20 +4,11 @@
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { Terminal } from "./terminal";
|
||||
import type { TabId } from "../dock-store/dock.store";
|
||||
import type { TabId } from "../dock/store";
|
||||
import type { TerminalApi } from "../../../api/terminal-api";
|
||||
import dockStoreInjectable from "../dock-store/dock-store.injectable";
|
||||
|
||||
const createTerminalInjectable = getInjectable({
|
||||
instantiate: (di) => {
|
||||
const dependencies = {
|
||||
dockStore: di.inject(dockStoreInjectable),
|
||||
};
|
||||
|
||||
return (tabId: TabId, api: TerminalApi) =>
|
||||
new Terminal(dependencies, tabId, api);
|
||||
},
|
||||
|
||||
instantiate: () => (tabId: TabId, api: TerminalApi) => new Terminal(tabId, api),
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user