-
Notifications
You must be signed in to change notification settings - Fork 1
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
FEAT: todolist 클래스 구현 #88
The head ref may contain hidden characters: "83-feat-todolist-\uD074\uB798\uC2A4-\uAD6C\uD604"
Conversation
Codecov ReportBase: 93.18% // Head: 69.81% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #88 +/- ##
===========================================
- Coverage 93.18% 69.81% -23.37%
===========================================
Files 3 3
Lines 132 222 +90
Branches 28 39 +11
===========================================
+ Hits 123 155 +32
- Misses 9 64 +55
- Partials 0 3 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
bb7bafb
to
845d66f
Compare
🚀 TEST RESULT SUMMARY❌ client/reports/jest-junit.xml119 tests were completed in 6s with 71 passed, 48 failed and 0 skipped.
✅ src/core/todo/test/sort.test.ts
❌ src/core/todo/test/update.test.ts
✅ src/core/todo/test/validator.test.ts
|
개요
세부 내용
Todo
클래스inputTodo
interface를 만들어서 필수로 받아야하는 field를 정의했습니다.null | undefined
일 경우의 default value를 가지도록 했습니다.compare
함수TodoList
이고 정렬당하는 주체는Todo
이므로Todo
클래스 내의 static 메서드로 만들었습니다.TodoList
에서 Active Todo의 상태 변경을 하기 위한 메서드를 만들었습니다.this
를 반환합니다.clone
메서드TodoList
에서 컴포넌트에 제공하는 interface들은 새로운TodoList
를 반환하는데 이때Todo
들도 복사해주기 위한 메서드입니다.toComparableTodo
메서드TodoList
클래스Todo[]
만을 가지고 있고 Active Todo에 변경사항이 있을 경우 이를 deep copy 후 새로운TodoList
인스턴스를 반환합니다.InputTodo[]
를 받아(최소 조건의 field 이상을 가지고 있는 Todo 객체)Todo[]
를 저장한다.postponeTemporally
,postponeDeadline
,postponeForToday
,lowerImportance
,setDone
TodoList
의 인스턴스를 반환합니다.getActiveTodo
메서드Todo
,TodoList
로 변경했습니다.공유
클래스를 사용할지 object를 사용할지
아주 조금이라도 자원을 더 아낄 수 있다
순수하게 할 때 투두의 업데이트를 투두리스트에서 고려해야한다
todo
를 관리하는 함수 +todoList
를 관리하는 함수를 합성relevant issue number