-
Notifications
You must be signed in to change notification settings - Fork 213
[10기 김장후] TodoList with CRUD #216
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
Open
kimjanghu
wants to merge
14
commits into
next-step:kimjanghu
Choose a base branch
from
kimjanghu:kimjanghu
base: kimjanghu
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
0355050
feat: 초기 설정
kimjanghu 3fda74c
feat: entry point 설정
kimjanghu 0fb7a79
feat: core component 추가
7c73ad4
feat: core state 추가
5da65a2
feat: todo 추가
1f04215
feat: todo data 형식 변경
86965d7
feat: WIP todoList checkbox 진행중..
fabc69e
feat: Add check todo
kimjanghu 58bb086
chore: constants name 수정
kimjanghu 442933a
feat: todo 삭제
kimjanghu 57aea54
feat: 총 todo 갯수 표시
kimjanghu 12a311c
feat: todo 수정
kimjanghu d69a150
feat: todo 수정 및 총 갯수 표시 추가
kimjanghu b4592f1
feat: todo filter 적용
kimjanghu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,25 @@ | ||
| export default class App { | ||
| constructor($target) { | ||
| console.log($target); | ||
| import NewTodoInput from './components/NewTodoInput.js'; | ||
| import Component from './core/component.js'; | ||
| import State from './core/State.js'; | ||
| import { $ } from './utils/utils.js'; | ||
|
|
||
| export default class App extends Component { | ||
| setState() { | ||
| this.todoList = new State([]); | ||
| } | ||
|
|
||
| render() { | ||
| this.mountChildren(); | ||
| } | ||
|
|
||
| mountChildren() { | ||
| new NewTodoInput($('#new-todo-title'), { | ||
| todoList: this.todoList, | ||
| onSubmitTodo: this.onSubmitTodo, | ||
| }); | ||
| } | ||
|
|
||
| onSubmitTodo() { | ||
| console.log(this.todoList); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import Component from '../core/component.js'; | ||
|
|
||
| export default class NewTodoInput extends Component { | ||
| render() {} | ||
|
|
||
| bindEvents() { | ||
| this.$target.addEventListener('keyup', ({ key }) => { | ||
| if (key !== 'Enter') return; | ||
| this.addTodo(this.$target.value); | ||
| this.$target.value = ''; | ||
| this.props.onSubmitTodo(); | ||
| }); | ||
| } | ||
|
|
||
| addTodo(todo) { | ||
| const todoList = this.props.todoList.get(); | ||
| todoList.push(todo); | ||
| this.props.todoList.set(todoList); | ||
| } | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
(질문) 여기서 ({ key }) 이렇게 하는 것과 ( key ) 이렇게 하는 것은 차이가 없겠지요?
기초적일 수 있지만 여쭈어 보아요.
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.
음 destructuring 키워드를 찾아보시면 될 것같아요! 차이는 없지만 전 가독성 측면에서 destructuring을 즐겨써요