Skip to content

homework 5#51

Open
MrBlackD wants to merge 1 commit into
romabelka:masterfrom
MrBlackD:home-work-5
Open

homework 5#51
MrBlackD wants to merge 1 commit into
romabelka:masterfrom
MrBlackD:home-work-5

Conversation

@MrBlackD
Copy link
Copy Markdown

No description provided.

Comment thread src/reducer/comments.js

const ReducerState = Record({
entities: arrToMap([], CommentRecord),
loading: false,
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

здесь не достаточно повесить loading на весь comments, ведь ты для конкрентной статьи загружаешь

Comment thread src/reducer/comments.js
return state.set("loading",true)

case LOAD_COMMENTS + SUCCESS:
return state.update("entities",comments=>comments.merge(arrToMap(payload.response,CommentRecord)))
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

.mergeIn

Comment thread src/reducer/comments.js
case LOAD_COMMENTS + SUCCESS:
return state.update("entities",comments=>comments.merge(arrToMap(payload.response,CommentRecord)))
.set("loading",false)
.set("loaded",true)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Почему loaded === true, ведь ты загрузил только для одной статьи?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Но ведь процесс загрузки комментариев был(хоть и для одной страницы) и нужно показать что он окончен. А в article я поставил признак, загружены ли комментарии для данной страницы

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