File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ const setFilter = ( newFilter = Filters.All ) => {
100100}
101101
102102const getCurrentFilter = ( ) => {
103- return state . filter ;
103+ return state . filter ;
104104}
105105
106106
Original file line number Diff line number Diff line change @@ -4,7 +4,8 @@ import { renderTodos } from './use-cases';
44const ElementIDs = {
55 TodoList :'.todo-list' ,
66 NewTodoInput :'#new-todo-input' ,
7- DeleteElement :".destroy"
7+ DeleteElement :".destroy" ,
8+ ClearCompletedButton :".clear-completed" ,
89}
910
1011/**
@@ -35,7 +36,7 @@ export const App = ( elementId ) => {
3536 const newDescriptionInput = document . querySelector ( ElementIDs . NewTodoInput )
3637 const todoListUL = document . querySelector ( ElementIDs . TodoList )
3738 const destroylistUl = document . querySelector ( ElementIDs . DeleteElement )
38-
39+ const clearCompletedButton = document . querySelector ( ElementIDs . ClearCompletedButton )
3940
4041
4142 //listeners
@@ -65,6 +66,12 @@ export const App = ( elementId ) => {
6566 } ) ;
6667
6768
69+ clearCompletedButton . addEventListener ( 'click' , ( ) => {
70+ todoStore . deleteCompleted ( ) ;
71+ displayTodos ( ) ;
72+ } ) ;
73+
74+
6875}
6976
7077
You can’t perform that action at this time.
0 commit comments