Skip to content

Hw 5#53

Open
boombarashk wants to merge 2 commits into
romabelka:masterfrom
boombarashk:HW-5
Open

Hw 5#53
boombarashk wants to merge 2 commits into
romabelka:masterfrom
boombarashk:HW-5

Conversation

@boombarashk
Copy link
Copy Markdown

не удался каменный цветок

{
comments.length
? this.getComments()
commentsMap.size
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.

Если очень хочешь так делать - сделай лучше в коннекте. А вообще у нас Comment умеет достать объект по id

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 comments
.set('entities', arrToMap(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, ведь ты загрузил только для одной статьи?

Comment thread src/reducer/comments.js
case LOAD_COMMENTS + SUCCESS:
console.log("bzzzzz", response)
return comments
.set('entities', arrToMap(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

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