Skip to content

Conversation

@nikolaySolodkiy
Copy link

Пагинацию сделал, но запрос каждый раз отправляется при переходе на страницу, пока не придумал как лучше хранить комментарии, чтобы у них номер страницы присутствовал

}
}

export function loadAllComments(limit = 5, offset = 0, page = 1) {
Copy link
Owner

Choose a reason for hiding this comment

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

я бы передавал page, а уже тут превращал это в offset и limit


case LOAD_ALL_COMMENTS + SUCCESS:
return state
.setIn(['entities'], arrToMap(response.records, 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