mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Introduce a centralised way to emit telemetry from calls of injectable functions (#6164)
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi> Co-authored-by: Juho Heikka <juho.heikka@gmail.com>
This commit is contained in:
43 files changed
+527
-163
No files matched your search
@@ -3,6 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { runInAction } from "mobx";
|
||||
import type { LensExtension } from "../../lens-extension";
|
||||
import { extensionRegistratorInjectionToken } from "../extension-registrator-injection-token";
|
||||
|
||||
@@ -27,17 +28,23 @@ const extensionInjectable = getInjectable({
|
||||
getInjectablesOfExtension(instance),
|
||||
);
|
||||
|
||||
childDi.register(...injectables);
|
||||
runInAction(() => {
|
||||
childDi.register(...injectables);
|
||||
});
|
||||
},
|
||||
|
||||
deregister: () => {
|
||||
parentDi.deregister(extensionInjectable);
|
||||
runInAction(() => {
|
||||
parentDi.deregister(extensionInjectable);
|
||||
});
|
||||
},
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
parentDi.register(extensionInjectable);
|
||||
runInAction(() => {
|
||||
parentDi.register(extensionInjectable);
|
||||
});
|
||||
|
||||
return parentDi.inject(extensionInjectable);
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user