-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lesson6.1 #13
base: master
Are you sure you want to change the base?
Conversation
…updating likes) for both posts & post pages.
…menting post likes. Created store and wrapped App component in Provider.
…prepareData methods to app routes. Created history callback to compare current URL with routes templates and call corresponding prepareData method, hang it onto browserHistory object and added initial call when the app is initialized.
…ols block to DOM, made DevTools component render, added DevTools engancer to redux store.
…stateless. Got rid of BlogPage component & helpers for incrementing likes & interacting with API.
… issue, fixed ownProps issue in PostContainer.
…ng posts list & piechart.
…modules, added processing action for incrementing likes count in post & posts reducers, created LikeContainer. Moved away PagaContainer & added two containers: for PieChart & BlogList.
modified={metaInfo.modified} | ||
/> | ||
<LikeContainer | ||
likes={metaInfo.likes} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
количество лайков можно получить в контейнере
_.assign({}, MetaInfo.propTypes, _.pick(Like.propTypes, ['likes'])) | ||
), | ||
like: Like.propTypes.like | ||
_.assign({}, MetaInfo.propTypes, _.pick(LikeContainer.propTypes, ['likes'])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
лучше импортировать конкретные функции (import { assign, pick } from 'lodash'
). Так запись здесь будет короче, а в конечный бандл попадут только нужные функции (при применении метода tree-shaking в сборке)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Стараюсь уже так делать, надо поубирать где осталось по старому. Спасибо!
Обязателько почитаю про метод tree-shaking в сборке. Не знал об этом.
like: () => dispatch(incrementLike(ownProps.id)) | ||
}); | ||
|
||
export default connect(null, actionsToProps)(Like); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
здесь можно добавить stateToProps и используя ownProps достать количество лайков
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Доделаю! СПС!
No description provided.