mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
chore: extract @k8slens/random
Signed-off-by: Gabriel <gaccettola@mirantis.com>
This commit is contained in:
1 parent
847f2b1b7b
commit
86fa93ac8b
30 files changed
+137
-20
No files matched your search
@@ -0,0 +1,14 @@
|
||||
import { getFeature } from "@k8slens/feature-core";
|
||||
import { autoRegister } from "@ogre-tools/injectable-extension-for-auto-registration";
|
||||
|
||||
export const randomFeature = getFeature({
|
||||
id: "random-feature",
|
||||
|
||||
register: (di) => {
|
||||
autoRegister({
|
||||
di,
|
||||
targetModule: module,
|
||||
getRequireContexts: () => [require.context("./", true, /\.injectable\.(ts|tsx)$/)],
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* 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 { v4 as getRandomId } from "uuid";
|
||||
|
||||
export const getRandomIdInjectable = getInjectable({
|
||||
id: "get-random-id",
|
||||
instantiate: () => () => getRandomId(),
|
||||
causesSideEffects: true,
|
||||
});
|
||||
Reference in new issue
Block a user