chore: Extract an injectionToken

Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
This commit is contained in:
Iku-turso authored and Sebastian Malton committed 2023-04-25 17:38:02 -04:00
1 parent 0dae1594ba
commit db9a3675e1
7 files changed
+19 -14

No files matched your search

+1 -1
View File
@@ -3,7 +3,7 @@
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
export { historyInjectable } from "./src/history.injectable";
export { historyInjectionToken } from "./src/history.injectable";
export { observableHistoryInjectable } from "./src/observable-history.injectable";
export { searchParamsOptions } from "./src/search-params";
export { routingFeature } from "./src/feature";
+8 -3
View File
@@ -2,11 +2,16 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
import { createBrowserHistory } from "history";
import { getInjectable, getInjectionToken } from "@ogre-tools/injectable";
import type { History } from "history";
import { createBrowserHistory } from "history";
export const historyInjectionToken = getInjectionToken<History>({
id: "history-injection-token",
});
export const historyInjectable = getInjectable({
id: "history",
instantiate: (): History => createBrowserHistory(),
instantiate: () => createBrowserHistory(),
injectionToken: historyInjectionToken,
});