mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
* Reorganize stuff to prevent circular dependencies Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Install injectable extension to allow injecting reactively many implementations Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Switch to using computedInjectMany over filtering injectMany based on enabled extensions for simplicity Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Remove await for not being needed Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Sort dependencies alphabetically Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
24 lines
888 B
TypeScript
24 lines
888 B
TypeScript
/**
|
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
|
*/
|
|
import { getInjectable, getInjectionToken } from "@ogre-tools/injectable";
|
|
import { computedInjectManyInjectable } from "@ogre-tools/injectable-extension-for-mobx";
|
|
import type { RegisteredAppPreference } from "./app-preferences/app-preference-registration";
|
|
|
|
export const extensionPreferenceItemInjectionToken = getInjectionToken<RegisteredAppPreference>({
|
|
id: "extension-preference-item-injection-token",
|
|
});
|
|
|
|
const extensionsPreferenceItemsInjectable = getInjectable({
|
|
id: "extension-preference-items",
|
|
|
|
instantiate: (di) => {
|
|
const computedInjectMany = di.inject(computedInjectManyInjectable);
|
|
|
|
return computedInjectMany(extensionPreferenceItemInjectionToken);
|
|
},
|
|
});
|
|
|
|
export default extensionsPreferenceItemsInjectable;
|