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.
코드잼을 하면서
todo-list
내부의 todo item을todo-list-item
이라는 컴포넌트로 나누어 만들어 보았습니다.todo
라는Todo
타입의 input을 받습니다.updateStateEvent
를 발생시킵니다.deleteEvent
를 발생시킵니다.부모 컴포넌트인
todo-list
에서는item
을todo
로 넘겨줍니다.updateStateEvent
의 콜백으로switchState
를 등록합니다.deleteEvent
의 콜백으로delTodo
를 등록합니다.React 코드로 굳이 표현하자면 이런 느낌입니다.
Angular스러운 방법인지는 스스로 판단할 수가 없지만,
@Output
과EventEmitter
로 만든 구조가 대응되는 React 코드에 비해 선언적인 것이 인상적이었습니다. 한 번 확인해 보시고 의견 남겨주세요!