File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
packages/0/src/factories/createContext Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -14,13 +14,13 @@ export type ContextKey<Z> = InjectionKey<Z> | string
14
14
*/
15
15
export function useContext < Z > ( key : ContextKey < Z > ) {
16
16
return function ( ) : Z {
17
- const contextValue = inject < Z > ( key )
17
+ const context = inject < Z > ( key )
18
18
19
- if ( contextValue === undefined ) {
19
+ if ( context === undefined ) {
20
20
throw new Error ( `Context "${ String ( key ) } " not found. Ensure it's provided by an ancestor.` )
21
21
}
22
22
23
- return contextValue
23
+ return context
24
24
}
25
25
}
26
26
@@ -35,10 +35,10 @@ export function useContext<Z> (key: ContextKey<Z>) {
35
35
* @see https://0.vuetifyjs.com/composables/foundation/create-context
36
36
*/
37
37
export function createContext < Z > ( key : ContextKey < Z > ) {
38
- function provideContext ( value : Z , app ?: App ) {
39
- app ? app . provide ( key , value ) : provide ( key , value )
38
+ function provideContext ( context : Z , app ?: App ) {
39
+ app ? app . provide ( key , context ) : provide ( key , context )
40
40
41
- return value
41
+ return context
42
42
}
43
43
44
44
return [ useContext < Z > ( key ) , provideContext ] as const
You can’t perform that action at this time.
0 commit comments