Skip to content

Hometask6#79

Open
Roughtron wants to merge 1 commit intoromabelka:masterfrom
Roughtron:hometask6
Open

Hometask6#79
Roughtron wants to merge 1 commit intoromabelka:masterfrom
Roughtron:hometask6

Conversation

@Roughtron
Copy link

No description provided.

const body = comments.length ? (
<ul>
{comments.map(id => <li key = {id}><Comment id = {id} /></li>)}
{comments.map(item => <li key = {item.id}><Comment id = {item.id} /></li>)}
Copy link
Owner

Choose a reason for hiding this comment

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

не понял. Зачем ты достаешь id, чтоб потом сразу же по этому id искать этот же коммент в сторе?


const ReducerRecord = Record({
entities: arrToMap([], commentRecord),
loading: false,
Copy link
Owner

Choose a reason for hiding this comment

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

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

return state
.set('entities', arrToMap(payload.response, commentRecord))
.set('loading', false)
.set('loaded', true)
Copy link
Owner

Choose a reason for hiding this comment

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

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


case LOAD_COMMENTS + SUCCESS:
return state
.set('entities', arrToMap(payload.response, commentRecord))
Copy link
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