Skip to content

Conversation

@NtonBala
Copy link
Owner

No description provided.

…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.
…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}

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']))

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 в сборке)

Copy link
Owner Author

@NtonBala NtonBala Nov 23, 2017

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);

Choose a reason for hiding this comment

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

здесь можно добавить stateToProps и используя ownProps достать количество лайков

Copy link
Owner Author

@NtonBala NtonBala Nov 23, 2017

Choose a reason for hiding this comment

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

Доделаю! СПС!

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.

3 participants