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

feat(in-app): preset article data #824

Closed
wants to merge 7 commits into from
Closed

Conversation

sdjdd
Copy link
Contributor

@sdjdd sdjdd commented May 11, 2023

/categories/:id/(notices|topics|faqs) 返回完整的文章数据,in-app 在获取时同时填充到对应文章资源的 query data 中。这样点击跳转到文章详情页就不用重复获取了。

@sdjdd sdjdd requested a review from leeyeh May 11, 2023 04:50
return useQuery({
queryKey: ['article', id],
queryFn: () => getArticle(id),
staleTime: 60_000,
Copy link
Contributor

Choose a reason for hiding this comment

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

这个 stale time 是不是不要完全去掉会更好。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

在 ArticleDetail 里设置成 Infinity 了。

@sdjdd
Copy link
Contributor Author

sdjdd commented May 15, 2023

#826 解决了 404 的问题,这个就关了。

@sdjdd sdjdd closed this May 15, 2023
@sdjdd sdjdd deleted the feat/in-app-preset-article branch May 15, 2023 02:47
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.

2 participants