Skip to content

comments loading wrote#45

Open
kazminigor1988 wants to merge 1 commit intoromabelka:masterfrom
kazminigor1988:hm5-kazmin
Open

comments loading wrote#45
kazminigor1988 wants to merge 1 commit intoromabelka:masterfrom
kazminigor1988:hm5-kazmin

Conversation

@kazminigor1988
Copy link
Copy Markdown

No description provided.

Comment thread src/reducer/comments.js
})
return state.set(
'entities',
state.get('entities').set(
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.

.setIn для этого есть

Comment thread src/reducer/comments.js

const ReducerRecord = new Record({
entities: arrToMap([], CommentModel),
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/selectors/index.js
export const createCommentSelector = () => {
return createSelector(commentListSelector, idSelector, (comments, id) => {
return comments.get(id)
return comments.find((comment) => comment.id === id)
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.

просто из Map читай, а не List

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