-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
base: master
Are you sure you want to change the base?
Develop #1526
Conversation
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.
-
show loader on all todos on clear completed
-
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 -
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); |
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.
it can be just a variable
useEffect(() => { | ||
const IsAllCompleted = todos.every(todo => todo.completed); | ||
|
||
setAllCompleted(IsAllCompleted); | ||
}, [todos]); | ||
|
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.
useEffect(() => { | |
const IsAllCompleted = todos.every(todo => todo.completed); | |
setAllCompleted(IsAllCompleted); | |
}, [todos]); | |
const isAllCompleted = todos.every(todo => todo.completed); |
DEMO LINK