New issue
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
fix(useFavicon): writable return type #2036
Conversation
packages/core/useFavicon/index.ts
Outdated
export type UseFaviconValue = string | null | undefined | ||
export type UseFaviconGetter = () => UseFaviconValue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer to use literals directly
packages/core/useFavicon/index.ts
Outdated
/** | ||
* Reactive favicon. | ||
* | ||
* @see https://vueuse.org/useFavicon | ||
* @param newIcon | ||
* @param options | ||
*/ | ||
export function useFavicon(newIcon: MaybeRef<UseFaviconValue>, options?: UseFaviconOptions): Ref<UseFaviconValue> | ||
export function useFavicon(newIcon: ComputedRef<UseFaviconValue> | UseFaviconGetter, options?: UseFaviconOptions): ComputedRef<UseFaviconValue> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export function useFavicon(newIcon: ComputedRef<UseFaviconValue> | UseFaviconGetter, options?: UseFaviconOptions): ComputedRef<UseFaviconValue> | |
export function useFavicon(newIcon: MaybeComputedRef<UseFaviconValue>, options?: UseFaviconOptions): ComputedRef<UseFaviconValue> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case the return type for Ref will be ComputedRef.
I mean for useFavicon(ref('str')): ComputedRef
8043e2f
to
f5a825e
Compare
@antfu Sorry to get back to this again, but the function without parameters still returns a ComputedRef. Therefore, it still does not match the documentation. |
closes #2031
Description
Additional context
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).