test failed when using computedAsync in a composable #2953
Unanswered
ChasonZheng
asked this question in
Q&A
Replies: 1 comment
-
when i modify my composable like this: const useComputedAsync = (param: Ref<number>) => {
const double = computedAsync(() => { // just remove the async keyword
const result = unref(param) * 2;
return Promise.resolve(result);
});
return {
double
};
}; then it test success.why? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, all:
i write a composable with computedAsync like this:
then run test:
but the last expect failed, because double.value is undefinded. i don't known why, anyone can help me.
Beta Was this translation helpful? Give feedback.
All reactions