Introduce injection token as competition for injectable setup to have better control of timing of different setups

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne SavolainenandMikko Aspiala committed 2022-05-11 08:18:32 +03:00
1 parent 9f25212f45
commit b8fd1299ee
2 files changed
+26 -1

No files matched your search

@@ -0,0 +1,13 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectionToken } from "@ogre-tools/injectable";
export interface Setupable {
doSetup: () => Promise<void> | void;
}
export const setupableInjectionToken = getInjectionToken<Setupable>({
id: "setupable-injection-token",
});