1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/packages/random-id/src/get-random-id.injectable.ts
Gabriel 58e4ebcdea chore: bump package.json
Signed-off-by: Gabriel <gaccettola@mirantis.com>
2023-06-01 11:36:30 +02:00

19 lines
630 B
TypeScript

/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable, getInjectionToken } from "@ogre-tools/injectable";
import { v4 as getRandomId } from "uuid";
export type GetRandomId = () => string;
export const getRandomIdInjectionToken = getInjectionToken<GetRandomId>({
id: "get-random-id-injection-token",
});
export const getRandomIdInjectable = getInjectable({
id: "get-random-id",
instantiate: (): GetRandomId => () => getRandomId(),
causesSideEffects: true,
injectionToken: getRandomIdInjectionToken,
});