-
Notifications
You must be signed in to change notification settings - Fork 147
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
Why both user/totalTweets and user/stats/stats/tweets.length ? #45
Comments
I figured out the answer. I suggest renaming |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I wonder why do you use both
user/totalTweets
anduser/stats/stats/tweets.length
? What is the reason of keeping them in both places? And then when you display user's total tweets inuser-header.tsx
you add them together intwitter-clone/src/components/user/user-header.tsx
Line 38 in c6bf6fb
I also wonder why are they managed separatelly, i.e.
user.totalTweets
is incremented/decremented on client-side onlytwitter-clone/src/lib/firebase/utils.ts
Line 171 in c6bf6fb
While
user/stats/stats/tweets
is incremented/decremented on both client-sidetwitter-clone/src/lib/firebase/utils.ts
Line 210 in c6bf6fb
and only decremented on server-side via Cloud functions onDelete trigger)
twitter-clone/functions/src/normalize-stats.ts
Line 5 in c6bf6fb
The text was updated successfully, but these errors were encountered: