Don't convert functions with parameters
Some checks failed
Run Tests / test (pull_request) Failing after 1m34s
Some checks failed
Run Tests / test (pull_request) Failing after 1m34s
This commit is contained in:
parent
07718f6c48
commit
8861707822
1 changed files with 1 additions and 1 deletions
|
@ -5,7 +5,7 @@ import { computed } from "vue";
|
|||
export type MaybeGetter<T> = T | (() => 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 obj as ReturnType<typeof processGetter<T>>;
|
||||
|
|
Loading…
Reference in a new issue