Skip to content

HW-6 only 1 page#61

Open
boombarashk wants to merge 1 commit into
romabelka:masterfrom
boombarashk:HW-6
Open

HW-6 only 1 page#61
boombarashk wants to merge 1 commit into
romabelka:masterfrom
boombarashk:HW-6

Conversation

@boombarashk
Copy link
Copy Markdown

получившаяся конструкция взлетает единожды при отрисовке компонента

Comment thread src/AC/index.js
return {
type: LOAD_COMMENTS,
payload: { i },
callAPI: `/api/comment?limit=${LIMIT * i}&offset=${LIMIT * ++i}`
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.

++i так себе идея

import { LIMIT } from '../../constants'

class CommentsRoute extends Component {
componentDidMount(){
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 thread src/reducer/comments.js
console.log("SUCCESS load comments: ", response)

return state.set('total', response.total)
.setIn(['loadedComments', payload.i - 1], response.records)//arrToMap(response.records, 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.

Не хочешь records тоже immutable хранить, как остальные комменты?

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