Browse Source

Merge pull request #2943 from nocodb/feat/key-name-arg

pull/2945/head
Braks 2 years ago committed by GitHub
parent
commit
d046946ac2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      packages/nc-gui-v2/composables/useInjectionState/index.ts

3
packages/nc-gui-v2/composables/useInjectionState/index.ts

@ -2,8 +2,9 @@ import type { InjectionKey } from 'vue'
export function useInjectionState<Arguments extends any[], Return>(
composable: (...args: Arguments) => Return,
keyName = 'InjectionState',
): readonly [useProvidingState: (...args: Arguments) => void, useInjectedState: () => Return | undefined] {
const key: string | InjectionKey<Return> = Symbol('InjectionState')
const key: string | InjectionKey<Return> = Symbol(keyName)
const useProvidingState = (...args: Arguments) => {
const providedState = composable(...args)

Loading…
Cancel
Save