8000 feat(createInjectionState): injectionKey use composable name (#3788) · vueuse/vueuse@c2cfd34 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit c2cfd34

Browse files
feat(createInjectionState): injectionKey use composable name (#3788)
1 parent 31d4a49 commit c2cfd34

File tree

1 file changed

+1
-1
lines changed
  • packages/shared/createInjectionState

1 file changed

+1
-1
lines changed

packages/shared/createInjectionState/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function createInjectionState<Arguments extends Array<any>, Return>(
1919
composable: (...args: Arguments) => Return,
2020
options?: CreateInjectionStateOptions<Return>,
2121
): readonly [useProvidingState: (...args: Arguments) => Return, useInjectedState: () => Return | undefined] {
22-
const key: string | InjectionKey<Return> = options?.injectionKey || Symbol('InjectionState')
22+
const key: string | InjectionKey<Return> = options?.injectionKey || Symbol(composable.name || 'InjectionState')
2323
const useProvidingState = (...args: Arguments) => {
2424
const state = composable(...args)
2525
provideLocal(key, state)

0 commit comments

Comments
 (0)
0