-
Notifications
You must be signed in to change notification settings - Fork 24
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
[feat] replace asyncData with fetch #44
[feat] replace asyncData with fetch #44
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/nuxt-movies/nuxt-movies/99uAvVSPCPXoSqTLhDQeuFTXtURh |
async asyncData({ error }) { | ||
data() { | ||
return { | ||
trendingMovies: {}, |
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.
Tip: For data-reuse technique, we need a global store object otherwise fetched data will be lost (refetched) when going to a page and coming back
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.
@pi0 It makes sense. Thank you.
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.
@pi0 @danielroe @addyosmani
Could you please check #41 (comment)?
@pi0 |
@pi0 |
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 think we should move caching logic to tmdbAPI instead of doing inside page:
- Decouples page cache from data cache
- Allows universal caching (swr on server and client)
- Prevent caching duplicate data in memory if two pages fetch same endpoint
Hi @pi0 @danielroe
Actually, I think I have not correctly understood how to approach resolving these issues. |
* [fix] handle the duplicated keys in listing * [fix] handle the mising param for named route bug
@addyosmani |
#41