@@ -6,13 +6,13 @@ import { setItem } from "./utils/storage.js";
66import { TodoCount as TodoCnt , TodoItem } from "./types/todo.js" ;
77
88export default class App {
9- todoList : TodoList ;
10- todoCount : TodoCount ;
9+ private readonly todoList : TodoList ;
10+ private readonly todoCount : TodoCount ;
1111
1212 constructor (
13- protected readonly $target : HTMLElement ,
14- protected readonly initialState : TodoItem [ ] ,
15- protected readonly initialCount : TodoCnt
13+ private readonly $target : HTMLElement ,
14+ private readonly initialState : TodoItem [ ] ,
15+ private readonly initialCount : TodoCnt
1616 ) {
1717 new Header ( this . $target , "Todo List" ) ;
1818
@@ -27,14 +27,14 @@ export default class App {
2727 this . todoList = new TodoList (
2828 this . $target ,
2929 this . initialState ,
30- ( state : TodoItem [ ] ) => this . updateCount ( state )
30+ ( state : TodoItem [ ] ) => this . # updateCount( state )
3131 ) ;
3232
3333 this . todoCount = new TodoCount ( this . $target , this . initialCount ) ;
3434 }
3535
3636 // 카운트 업데이트
37- updateCount ( todoList : TodoItem [ ] ) {
37+ # updateCount( todoList : TodoItem [ ] ) {
3838 const done = todoList . filter ( ( todo ) => todo . isCompleted ) . length ;
3939 const nextState = { total : todoList . length , done } ;
4040 this . todoCount . setState ( nextState ) ;
0 commit comments