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

React-query-ify notifications #812

Merged
merged 2 commits into from
Aug 28, 2022
Merged

React-query-ify notifications #812

merged 2 commits into from
Aug 28, 2022

Conversation

jahooma
Copy link
Collaborator

@jahooma jahooma commented Aug 28, 2022

React query has a bug for subscribing to useFirestoreQueryData. I found a workaround online: invertase/tanstack-query-firebase#25

Secondly, I realized that if Nextjs Link components navigate client-side, we can always have the latest notifications fetched if we listen for them in the sidebar with the same query.

Now there is no fetch time at all to visit Notifications page! Except for the first load in which we show a loading indicator. Also removed the local storage for notifications since they are no longer necessary.

@vercel
Copy link

vercel bot commented Aug 28, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
dev ✅ Ready (Inspect) Visit Preview Aug 28, 2022 at 8:20PM (UTC)
docs ✅ Ready (Inspect) Visit Preview Aug 28, 2022 at 8:20PM (UTC)
opengraph-image ✅ Ready (Inspect) Visit Preview Aug 28, 2022 at 8:20PM (UTC)
prod ✅ Ready (Inspect) Visit Preview Aug 28, 2022 at 8:20PM (UTC)

@jahooma
Copy link
Collaborator Author

jahooma commented Aug 28, 2022

cc: @IanPhilips

@jahooma jahooma merged commit 9c15d5b into main Aug 28, 2022
@jahooma jahooma deleted the react-query-notifications branch August 28, 2022 20:20
@jahooma jahooma mentioned this pull request Aug 28, 2022
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.

1 participant