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