Skip to content

implement hometask 5#56

Open
MarinaBarinova wants to merge 1 commit intoromabelka:masterfrom
MarinaBarinova:hometask5
Open

implement hometask 5#56
MarinaBarinova wants to merge 1 commit intoromabelka:masterfrom
MarinaBarinova:hometask5

Conversation

@MarinaBarinova
Copy link

Добрый день
Сейчас у нас хранятся все загруженные комментарии на все приложение(используется mergeIn). Как сделать, чтобы состояние списка комментариев было уникальным для каждой статьи? В ArticleRecord делать Immutable List с комментариями? Но тогда получается громоздкая структура.

@romabelka
Copy link
Owner

если хочешь - да, но зачем?

export default connect(
null,
{
fetchData: (id) => {
Copy link
Owner

Choose a reason for hiding this comment

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

это зачем?

Copy link
Author

Choose a reason for hiding this comment

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

Я думала так нужно сделать, чтобы всегда передавался articleID

})
case LOAD_COMMENTS + START:
console.log('loading comments')
return state.set('loading', true).set('loaded', 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, ведь ты для конкрентной статьи загружаешь

Copy link
Author

Choose a reason for hiding this comment

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

Флаг в comments уже не используется, удалю. Я использую флаги commentsLoading / commentsLoaded, которые устанавливаю в reducer/articles при обработке LOAD_COMMENTS_START / LOAD_COMMENTS_SUCCESS

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