Skip to content
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: use Promise.resolve() to cover all possible promise cases #211

Merged
merged 1 commit into from
Aug 18, 2020
Merged

fix: use Promise.resolve() to cover all possible promise cases #211

merged 1 commit into from
Aug 18, 2020

Conversation

nvitaterna
Copy link
Contributor

Fixes #210. This will convert all callback given to useAsync to Promises. Ensures that if the callback is any sort of promise it will resolve properly. If the function is not a promise, Promise.resolve() shouldn't cause any issues.

@vercel
Copy link

vercel bot commented Aug 18, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nuxt-community/composition-api/nctjk0k1z
✅ Preview: https://composition-api-git-fork-nvitaterna-async-promise-fix.nuxt-community.vercel.app

Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

@danielroe danielroe changed the title use Promise.resolve() to cover all possible promise cases fix: use Promise.resolve() to cover all possible promise cases Aug 18, 2020
@danielroe danielroe merged commit 6d10312 into nuxt-community:main Aug 18, 2020
@danielroe
Copy link
Member

Thanks very much ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix: useAsync bug with Promises
2 participants