1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Replace logsViewModelInjectable lifecycle

to keyedSingleton

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2023-02-16 14:51:25 +03:00
parent de6f339fec
commit daf3fb92ea

View File

@ -28,7 +28,7 @@ export interface InstantiateArgs {
const logsViewModelInjectable = getInjectable({
id: "logs-view-model",
instantiate: (di, { tabId }: InstantiateArgs) => new LogTabViewModel(tabId, {
instantiate: async (di, tabId: TabId) => new LogTabViewModel(tabId, {
getLogs: di.inject(getLogsInjectable),
getLogsWithoutTimestamps: di.inject(getLogsWithoutTimestampsInjectable),
getTimestampSplitLogs: di.inject(getTimestampSplitLogsInjectable),
@ -45,7 +45,10 @@ const logsViewModelInjectable = getInjectable({
downloadAllLogs: di.inject(downloadAllLogsInjectable),
searchStore: di.inject(searchStoreInjectable),
}),
lifecycle: lifecycleEnum.transient,
lifecycle: lifecycleEnum.keyedSingleton({
getInstanceKey: (di, tabId: TabId) => `log-tab-view-model-${tabId}}`,
}),
});
export default logsViewModelInjectable;