[Team-13 iOS Neo] redux 구조 변경#54
Open
HoonHaChoi wants to merge 3 commits intocodesquad-members-2021:team-13from
Open
[Team-13 iOS Neo] redux 구조 변경#54HoonHaChoi wants to merge 3 commits intocodesquad-members-2021:team-13from
HoonHaChoi wants to merge 3 commits intocodesquad-members-2021:team-13from
Conversation
GangWoon
reviewed
Aug 1, 2021
|
|
||
| appCoordinator?.dispatch = appStore.dispatch(_:) | ||
| appStore.updateState = appCoordinator?.update(with:) | ||
| appCoordinator?.loadInitalView() |
There was a problem hiding this comment.
결과의 차이는 없겠지만, 엑션을 방출하는 건 외부에서 호출하는게 아닌 자기 자신이 해야할 의무같습니다.
|
|
||
| func update(with state: TokenState) { | ||
| switch state.token { | ||
| case .empty: |
There was a problem hiding this comment.
비동기적인 콜백함수를 처리하는 방식에 대해서 공부하셨으면 좋겠습니다.
Author
There was a problem hiding this comment.
넵 switch 문이 아닌 비동기 콜백으로 고쳐보도록하겠습니다
강운 혹시 이 부분에 대해 문제점이 무엇인가요??
Author
|
Effect는 처음보는거 같은데 찾아봐야겠네요 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

로그인 뷰 컨트롤러는 성공했다는 이벤트만 필요했기에 상태를 만들지 않고
클로저로 액션만 전달 하도록 변경했습니다
로그인 코디네이터 또한 이벤트만 전달만 하면 되기 때문에 클로저로 액선만 전달하도록 변경했고
앱코디네이터가 상태를 가지고 상태에 따라 화면이 변경되도록 수정했습니다!
참고 자료에서 AppStore에 state 있는데 ViewState 존재 이유를 몰랐었는데
리덕스는 새로운 state값을 만들어서 바꿔 return 할때 불변성 개념을 적용하고자 작성했었던 것 알게되었고
새로운 상태를 init로 생성해 주며 전달하기 까지 리덕스 개념과 흐름을 공부하는데 많이 도움이 되었습니다.
구조를 그려보면 이렇습니다!
