We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The type returned from inject resolves to the factory function, rather than the object returned from the factory. For example:
inject
const value = inject('key', () => 1, true)
This type of value is () => 1 instead of 1.
value
() => 1
1
The typescript signature for the function should be:
declare function inject<T>(key: InjectionKey<T> | string, defaultValue: T | (() => T), treatDefaultAsFactory?: boolean): T; ^^^^^^^^^^^^
I changed this in vue-composition-api.d.ts and it works as expected.
vue-composition-api.d.ts
The text was updated successfully, but these errors were encountered:
I have found this difference when coding computed-inject for vueuse, let me fix it.
Sorry, something went wrong.
fixed in v1.4.4
No branches or pull requests
The type returned from
inject
resolves to the factory function, rather than the object returned from the factory. For example:This type of
value
is() => 1
instead of1
.The typescript signature for the function should be:
I changed this in
vue-composition-api.d.ts
and it works as expected.The text was updated successfully, but these errors were encountered: