stemmlerjs / ddd-forum

Hacker news-inspired forum app built with TypeScript using DDD practices from solidbook.io.
https://dddforum.com
ISC License
1.94k stars 395 forks source link

[Redux]: When a vote changes, update the view #7

Open stemmlerjs opened 4 years ago

stemmlerjs commented 4 years ago

When someone changes their vote on a comment or post, we need to update the view.

Currently, we have to refresh the browser to see the changes.

On upvote:

On downvote:

aashir-khan commented 3 years ago

I'm attempting to fix this issue right now and I have a question. Without loss of generality, does the wasUpvotedByMe property on the PostDetails value object refer to whether the currently logged in user upvoted that post or does it refer to whether the owner of that post (the "Me" in "wasUpvotedByMe") upvoted that post?

If it is the former, then currently we are not sending the user id in for example when we get popular posts so we have no way of checking whether the the current post being mapped here has a vote that belongs to the currently logged in user. Currently we are only checking if there exists an upvoted vote for that boolean to be true, regardless who is logged in.

My changes thus far can be seen here