Don't convert functions with parameters
This commit is contained in:
parent
5bdb5ceed1
commit
0a5f63ff04
1 changed files with 1 additions and 1 deletions
|
@ -5,7 +5,7 @@ import { computed } from "vue";
|
||||||
export type MaybeGetter<T> = T | (() => T);
|
export type MaybeGetter<T> = T | (() => T);
|
||||||
|
|
||||||
export function processGetter<T>(obj: T): T extends () => infer S ? ComputedRef<S> : T {
|
export function processGetter<T>(obj: T): T extends () => infer S ? ComputedRef<S> : T {
|
||||||
if (isFunction(obj)) {
|
if (isFunction(obj) && obj.length === 0) {
|
||||||
return computed(obj) as ReturnType<typeof processGetter<T>>;
|
return computed(obj) as ReturnType<typeof processGetter<T>>;
|
||||||
}
|
}
|
||||||
return obj as ReturnType<typeof processGetter<T>>;
|
return obj as ReturnType<typeof processGetter<T>>;
|
||||||
|
|
Loading…
Reference in a new issue