Skip to content
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

ДЗ5 #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

ДЗ5 #68

wants to merge 1 commit into from

Conversation

chrstnv
Copy link

@chrstnv chrstnv commented Dec 3, 2020

No description provided.

loading: false,
loaded: false,
error: null,
visited: [],
Copy link
Owner

Choose a reason for hiding this comment

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

лучше объектом это хранить, удобнее проверка будет

averageRating: averageRatingSelector(state, props),
reviewsLoading: reviewsLoadingSelector(state),
reviewsLoaded: reviewsLoadedSelector(state),
visited: hasRestaurantReviewsVisited(state, {
Copy link
Owner

Choose a reason for hiding this comment

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

лучше так не делать, чтобы потом при изменении переписать только селектор и не трогать connect, то есть писать так - hasRestaurantReviewsVisited(state, props)

Copy link
Author

Choose a reason for hiding this comment

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

А где тогда лучше переименовать проп id, чтобы в селектор попал именно restaurantId? А то у меня в разных компонентах этот проп по разному называется, а селектор хочется один и тот же использовать

Copy link
Owner

Choose a reason for hiding this comment

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

лучше сделать тогда какую-то обертку над селекторами или разные селекторы иметь

@koretskiyav
Copy link
Owner

отличная работа

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