-
Notifications
You must be signed in to change notification settings - Fork 38
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
Discussion Count Redux #770
Conversation
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.
Looks good overall. I had some questions regarding the usage of a component
useEffect(() => { | ||
fetchDiscussionThreads(false, true); | ||
}, []); | ||
|
||
useEffect(() => { | ||
fetchDiscussionThreads(false, true); | ||
}, [filter, showTwitterComments]); |
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.
Could you double check logic here. Seems unnecessary to double fetch like this
@@ -380,7 +386,7 @@ const DiscussionTab = (props) => { | |||
) : showTwitterComments ? ( | |||
calculateCount() | |||
) : ( | |||
props.calculatedCount | |||
<DiscussionCount /> |
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.
Hmm, not sure if this needs to be a component. If we already have an access to the count via redux, we could probably just display it here.
If this was necessary, could you explain?
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.
Hey, I made it like this because I thought that was being asked: "Create a "root component" for Discussions that will fetch & propagate the redux data rather than having the fetch being done at the page-level component".
I may have misinterpreted what you were saying.
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 see your point though.
In the branch discussion-redux
, I made this component also take care of the loading state so it may gives it (being a component) a bit more validity. Let me know what you want me to do
@@ -467,7 +473,7 @@ const DiscussionTab = (props) => { | |||
type="beat" | |||
/> | |||
) : ( | |||
props.calculatedCount | |||
<DiscussionCount /> |
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.
same here.
Features
Resolves 2 / 3 of #759