-
Notifications
You must be signed in to change notification settings - Fork 7
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
refactor: employ useAsync composable to reduce repeated patterns in A… #79
base: main
Are you sure you want to change the base?
Conversation
Deploying with Cloudflare Pages
|
@Bogay @laporchen Please take a look first before I replace all the similar patterns into new style. |
if (!error.value) return null; | ||
else if (axios.isAxiosError(error.value) && error.value.response?.data?.message) { | ||
return error.value.response.data.message; | ||
} else { | ||
return "Unknown error occurred :("; | ||
} |
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.
I prefer to use early return to eliminate some nested code.
if (!error.value) return null; | |
else if (axios.isAxiosError(error.value) && error.value.response?.data?.message) { | |
return error.value.response.data.message; | |
} else { | |
return "Unknown error occurred :("; | |
} | |
if (!error.value) return null; | |
if (axios.isAxiosError(error.value) && error.value.response?.data?.message) { | |
return error.value.response.data.message; | |
} | |
return "Unknown error occurred :("; |
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.
that's a good point, will fix this.
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.
👍
…PI calls
close #32