Skip to content

Commit 5c467db

Browse files
authored
Fix(types): inject() return type
use undefined as return type instead of void close #290
1 parent 7c8386e commit 5c467db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/apis/inject.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ export function provide<T>(key: InjectionKey<T> | string, value: T): void {
3232
vm._provided[key as string] = value;
3333
}
3434

35-
export function inject<T>(key: InjectionKey<T> | string): T | void;
35+
export function inject<T>(key: InjectionKey<T> | string): T | undefined;
3636
export function inject<T>(key: InjectionKey<T> | string, defaultValue: T): T;
37-
export function inject<T>(key: InjectionKey<T> | string, defaultValue?: T): T | void {
37+
export function inject<T>(key: InjectionKey<T> | string, defaultValue?: T): T | undefined {
3838
if (!key) {
3939
return defaultValue;
4040
}

0 commit comments

Comments
 (0)