Skip to content

Mukeunzi & Jin step4-1 Refactoring#83

Merged
crongro merged 11 commits intocode-squad:mukeunzifrom
mukeunzi:step4-1
Apr 16, 2019
Merged

Mukeunzi & Jin step4-1 Refactoring#83
crongro merged 11 commits intocode-squad:mukeunzifrom
mukeunzi:step4-1

Conversation

@mukeunzi
Copy link
Copy Markdown

step4-1 리팩토링

  • class 키워드를 활용해 전체 구조 변경
  • 이전 풀리퀘 피드백 반영
    • 고차함수 활용
    • 전역변수 제거

Copy link
Copy Markdown
Contributor

@crongro crongro left a comment

Choose a reason for hiding this comment

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

수고했네요.

Class를 쓴 김에 Class를 좀더 공부하면 더 좋겠네요.
보통은 constructor에서 로직을 구현하진 않습니다. (객체를 생성하는 단계라서 생성에 집중하는 것이죠)

class Todo {
constructor(todos) {
this.todos = todos;
this.customTodos = todos.reduce(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

customTodos라는 것이 의미하는 것을 변수명으로는 알기 어렵네요.
setTodoCount() 라는 메서드를 만들고, 여기 코드를 옮기는 건 어때요?

@crongro crongro merged commit 71797eb into code-squad:mukeunzi Apr 16, 2019
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.

2 participants