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

HT5 done #46

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

HT5 done #46

wants to merge 1 commit into from

Conversation

chertt007
Copy link

No description provided.

} catch (error) {
dispatch({ type: LOAD_REVIEWS + FAILURE, error });
}
};
export const loadProducts = (restaurantId) => async (dispatch) => {
Copy link
Owner

Choose a reason for hiding this comment

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

продукты нужно было загрузить через api middleware

const { id, name, menu, reviews } = restaurant;
useEffect(() => {
const allProdArray = Object.keys(allProducts);
Copy link
Owner

Choose a reason for hiding this comment

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

я в своей домашке покажу, как это можно сделать немного красивее

reviews.includes(reviewId)
);

//todo fix loop
Copy link
Owner

Choose a reason for hiding this comment

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

лучше это сразу попровлять в селекторе averageRatingSelector

<Rate value={rating} />
const Review = ({ id }) => {
const allUsers = useSelector((state) => usersSelector(state));
const allReviews = useSelector((state) => state.reviews.entities);
Copy link
Owner

Choose a reason for hiding this comment

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

не забываем использовать селекторы

loadUsers,
}) => {
useEffect(() => {
loadUsers();
Copy link
Owner

Choose a reason for hiding this comment

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

тут все равно нужно проверку делать на loading, т.к. этот компонент может быть размонтирован и смонтирован повторно

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