-
Notifications
You must be signed in to change notification settings - Fork 8
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
🔀 :: (#492) PlaylistDetail을 ReactorKit으로 리팩합니다. #514
Conversation
✅ Successful finished SwiftLint |
✅ Assign 자동 지정을 성공했어요! |
Projects/Features/PlaylistFeature/Sources/Model/PlayListHeader.swift
Outdated
Show resolved
Hide resolved
Projects/Features/PlaylistFeature/Sources/Reactors/PlaylistDetailReactor.swift
Outdated
Show resolved
Hide resolved
Projects/Features/PlaylistFeature/Sources/Reactors/PlaylistDetailReactor.swift
Outdated
Show resolved
Hide resolved
Projects/Features/PlaylistFeature/Sources/Reactors/PlaylistDetailReactor.swift
Show resolved
Hide resolved
Projects/Features/PlaylistFeature/Sources/Reactors/PlaylistDetailReactor.swift
Outdated
Show resolved
Hide resolved
Projects/Features/PlaylistFeature/Sources/Reactors/PlaylistDetailReactor.swift
Outdated
Show resolved
Hide resolved
Projects/Features/PlaylistFeature/Sources/Reactors/PlaylistDetailReactor.swift
Outdated
Show resolved
Hide resolved
Projects/Features/PlaylistFeature/Sources/ViewControllers/PlayListDetailViewController.swift
Outdated
Show resolved
Hide resolved
Projects/Features/PlaylistFeature/Sources/ViewControllers/PlayListDetailViewController.swift
Outdated
Show resolved
Hide resolved
Projects/Features/PlaylistFeature/Sources/ViewControllers/PlayListDetailViewController.swift
Outdated
Show resolved
Hide resolved
Projects/Features/PlaylistFeature/Sources/ViewControllers/PlayListDetailViewController.swift
Show resolved
Hide resolved
Projects/Features/PlaylistFeature/Sources/ViewControllers/PlayListDetailViewController.swift
Show resolved
Hide resolved
Projects/Features/PlaylistFeature/Sources/Reactors/PlaylistDetailReactor.swift
Outdated
Show resolved
Hide resolved
Projects/Features/PlaylistFeature/Sources/Reactors/PlaylistDetailReactor.swift
Outdated
Show resolved
Hide resolved
Projects/Features/PlaylistFeature/Sources/Reactors/PlaylistDetailReactor.swift
Outdated
Show resolved
Hide resolved
Projects/Features/PlaylistFeature/Sources/Reactors/PlaylistDetailReactor.swift
Outdated
Show resolved
Hide resolved
Projects/Features/PlaylistFeature/Sources/Reactors/PlaylistDetailReactor.swift
Outdated
Show resolved
Hide resolved
Projects/Features/PlaylistFeature/Sources/Reactors/PlaylistDetailReactor.swift
Show resolved
Hide resolved
Projects/Features/PlaylistFeature/Sources/Reactors/PlaylistDetailReactor.swift
Outdated
Show resolved
Hide resolved
internal let type: PlayListType | ||
private var disposeBag = DisposeBag() | ||
internal let key: String |
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.
혹기 type이랑 key는 왜 internal인가요? 외부에서 접근하지고 않고 외부에서 접근하는거도 안좋은 동작이라 private가 적합한거같아서요
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.
어 둘다 뷰컨에서 써요
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.
음 그렇군요
일단 저거 private 사이에 넣어놓기보다 둘을 묶어서 따로 빼는게 보기 좋을거같아요
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.
반영햇습니다
|
||
case .tapEdit: | ||
return updateIsEditing(true) | ||
|
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.
case .tapEdit: | |
return updateIsEditing(true) | |
case .tapEdit: | |
return updateIsEditing(true) |
요기 줄바꿈이 이상한거같아요
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.
반영했습니다.
// TODO: 로그 찍기 , LogManager.printError("playlist detail datasource is empty") | ||
guard var tmp = currentState.dataSource.first?.items else { | ||
return .empty() | ||
} |
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.
엇 로그는 안찍는건가요
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.
로그는 병합하고 이용할 수 있지 않나요 ?? LogManager 자체가 지금 제 브랜치에서는 없어요
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.
pull이나 rebase 하셔여할거같아요 develop에 머지됐어요
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.
로깅 적용
Projects/Features/PlaylistFeature/Sources/Reactors/PlaylistDetailReactor.swift
Outdated
Show resolved
Hide resolved
tableView.register( | ||
UINib(nibName: "SongListCell", bundle: BaseFeatureResources.bundle), | ||
forCellReuseIdentifier: "SongListCell" | ||
) |
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.
이 친구는 bind보다 configureUI가 더 적절하지 않으려나요.?.?
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.
엇 이동하겠습니다.
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.
반영 완료
return | ||
} | ||
self.activityIndicator.stopAnimating() | ||
let currentState = reactor.state |
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.
let currentState = reactor.state | |
let currentState = reactor.state.share(replay: 4) |
이러면 옵져버블 스트림 하나로 여럿에 공유가능해요
ref : https://reactivex.io/documentation/operators/refcount.html
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.
그러니깐 4번을 한 흐름으로 처리한다는 뜻인가요 ?
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.
네네
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.
오 신기하다 ...
…ailReactor.swift Co-authored-by: baegteun <[email protected]>
8cb5f25
to
893d8df
Compare
} | ||
|
||
// 데이터 업데이트 | ||
|
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.
Before
// 데이터 업데이트
func updateDataSource(_ isBackup: Bool) -> Observable<Mutation> {
After
/// 데이터 업데이트
func updateDataSource(_ isBackup: Bool) -> Observable<Mutation> {
주석 방식이 얘만 달라요!
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.
확인!
Projects/Features/PlaylistFeature/Sources/ViewControllers/PlayListDetailViewController.swift
Show resolved
Hide resolved
guard let self = self else { | ||
.bind(onNext: { owner, model in | ||
|
||
guard let type = owner.reactor?.type else { |
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.
Before
guard let type = owner.reactor?.type else {
return
}
After
guard let type = owner.reactor?.type else { return }
간단한 guard else return 구문은 한줄로 표현하는게 가독성이 좋은것같아요
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.
확인했씁니다. 근데 이거 제안 기능으로 바로 올려주실 수 있던걸로 알아요 한번 나중에는 그렇게 해보실래여? 그러면 바로 커밋 가능
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.
어 다시보니 이 type 변수를 안 사용하네요?
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.
그것도 수정했씁니다 !
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.
확인했씁니다. 근데 이거 제안 기능으로 바로 올려주실 수 있던걸로 알아요 한번 나중에는 그렇게 해보실래여? 그러면 바로 커밋 가능
아 이건 몰랐네요! 한번 써볼게용
|
||
self.playListImage.kf.setImage( | ||
with: type == .wmRecommend ? WMImageAPI.fetchRecommendPlayListWithSquare( | ||
owner.playListImage.kf.setImage( |
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.
// Before
owner.playListImage.kf.setImage(
with: owner.reactor?.type == .wmRecommend ? WMImageAPI.fetchRecommendPlayListWithSquare(
id: model.image,
version: model.version
).toURL : WMImageAPI.fetchPlayList(id: model.image, version: model.version).toURL
// After
let imageURL = owner.reactor?.type == .wmRecommend ?
WMImageAPI.fetchRecommendPlayListWithSquare(id: model.image, version: model.version).toURL :
WMImageAPI.fetchPlayList(id: model.image, version: model.version).toURL
owner.playListImage.kf.setImage(
with: imageURL,
...
)
코드가 너무 길어서 가독성을 위해 imageURL을 변수로 따로 뺴고 들여쓰기도 수정해봤는데 이런 방식은 어떤가요?
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.
오 좋은 것 같아요 ! 반영할께요
Projects/Features/PlaylistFeature/Sources/ViewControllers/PlayListDetailViewController.swift
Show resolved
Hide resolved
Projects/Features/PlaylistFeature/Sources/ViewControllers/PlayListDetailViewController.swift
Outdated
Show resolved
Hide resolved
moreButton.rx.tap | ||
.withUnretained(self) | ||
.subscribe(onNext: { owner, _ in | ||
|
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.
공백을 제거해요
backButton.rx.tap | ||
.withUnretained(self) | ||
.subscribe(onNext: { owner, _ in | ||
|
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.
공백을 제거해요
} | ||
) | ||
owner.showPanModal(content: vc) | ||
|
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.
공백을 제거해요
Projects/Features/PlaylistFeature/Sources/ViewControllers/PlayListDetailViewController.swift
Outdated
Show resolved
Hide resolved
Projects/Features/PlaylistFeature/Sources/ViewControllers/PlayListDetailViewController.swift
Outdated
Show resolved
Hide resolved
…ListDetailViewController.swift Co-authored-by: Youngkyu Song <[email protected]>
…ListDetailViewController.swift Co-authored-by: Youngkyu Song <[email protected]>
…ListDetailViewController.swift Co-authored-by: Youngkyu Song <[email protected]>
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.
리액터킷으로 리팩하니까 코드 흐름파악하기가 좋아서 리뷰하기도 편하네요👀👍
💡 배경 및 개요
Resolves: #492
📃 작업내용
🙋♂️ 리뷰노트
✅ PR 체크리스트
XCConfig
,노션
,README
)"API 개발 완료됐어요"
,"XCConfig 값 추가되었어요"
)🎸 기타
남은 작업