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

Develop #1526

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Develop #1526

wants to merge 4 commits into from

Conversation

NazarHaida
Copy link

Copy link

@etojeDenys etojeDenys left a comment

Choose a reason for hiding this comment

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

  1. show loader on all todos on clear completed

  2. you don't need to call getTodos after clear completed logic, it looks redundant
    https://github.com/user-attachments/assets/6625ff57-c929-417f-8fdb-5f62bf42b53b

  3. you don't need to show the loader in this case

Screen.Recording.2024-11-30.at.11.34.25.mov

const [updatingStatusIds, setUpdatingStatusIds] = useState<Set<number>>(
new Set(),
);
const [allCompleted, setAllCompleted] = useState(false);

Choose a reason for hiding this comment

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

it can be just a variable

Comment on lines +179 to +184
useEffect(() => {
const IsAllCompleted = todos.every(todo => todo.completed);

setAllCompleted(IsAllCompleted);
}, [todos]);

Choose a reason for hiding this comment

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

Suggested change
useEffect(() => {
const IsAllCompleted = todos.every(todo => todo.completed);
setAllCompleted(IsAllCompleted);
}, [todos]);
const isAllCompleted = todos.every(todo => todo.completed);

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