From 4f463c6365d79a3e21781b0f7c245e03805d35c7 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Mon, 1 Aug 2022 22:25:47 +0200 Subject: [PATCH] feat(gui-v2): accept keyname as arg for useInjectionState --- packages/nc-gui-v2/composables/useInjectionState/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/nc-gui-v2/composables/useInjectionState/index.ts b/packages/nc-gui-v2/composables/useInjectionState/index.ts index b1a01007eb..6cd0f3dbd9 100644 --- a/packages/nc-gui-v2/composables/useInjectionState/index.ts +++ b/packages/nc-gui-v2/composables/useInjectionState/index.ts @@ -2,8 +2,9 @@ import type { InjectionKey } from 'vue' export function useInjectionState( composable: (...args: Arguments) => Return, + keyName = 'InjectionState', ): readonly [useProvidingState: (...args: Arguments) => void, useInjectedState: () => Return | undefined] { - const key: string | InjectionKey = Symbol('InjectionState') + const key: string | InjectionKey = Symbol(keyName) const useProvidingState = (...args: Arguments) => { const providedState = composable(...args)