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:
authored and GitHub committed 2022-09-02 09:33:22 -04:00
1 parent 60b538eec1
commit fc3512daf2
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 type { DiContainer } from "@ogre-tools/injectable";
import { runInAction } from "mobx";
import type { CreateStorage } from "./create-storage";
import createStorageInjectable from "./create-storage.injectable";
@@ -19,8 +20,10 @@ export const controlWhenStoragesAreReady = (di: DiContainer) => {
return storage;
};
// TODO: Remove when typing is added to the library
(di as any).decorateFunction(createStorageInjectable, decorated);
runInAction(() => {
// TODO: Remove when typing is added to the library
(di as any).decorateFunction(createStorageInjectable, decorated);
});
return async () => {
await Promise.all(storagesAreReady);