File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
packages/0/src/factories/createContext Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -4,13 +4,15 @@ import { inject, provide } from 'vue'
4
4
// Types
5
5
import type { App , InjectionKey } from 'vue'
6
6
7
+ export type ContextKey < Z > = InjectionKey < Z > | string
8
+
7
9
/**
8
10
* A simple wrapper for tapping into a v0 namespace
9
11
* @param key The provided string or InjectionKey
10
12
* @template Z The type values for the context.
11
13
* @returns A function that retrieves context
12
14
*/
13
- export function useContext < Z > ( key : InjectionKey < Z > | string ) {
15
+ export function useContext < Z > ( key : ContextKey < Z > ) {
14
16
return function ( ) : Z {
15
17
const contextValue = inject < Z > ( key )
16
18
@@ -32,7 +34,7 @@ export function useContext<Z> (key: InjectionKey<Z> | string) {
32
34
* @see https://vuejs.org/guide/components/provide-inject
33
35
* @see https://0.vuetifyjs.com/composables/foundation/create-context
34
36
*/
35
- export function createContext < Z > ( key : InjectionKey < Z > | string ) {
37
+ export function createContext < Z > ( key : ContextKey < Z > ) {
36
38
function provideContext ( value : Z , app ?: App ) {
37
39
app ? app . provide ( key , value ) : provide ( key , value )
38
40
You can’t perform that action at this time.
0 commit comments