Skip to content

Commit

Permalink
⚡ :: [#201] SelfStudyFeature / 데이터 가져오는 시점 viewDidLoad -> viewWillAppear
Browse files Browse the repository at this point in the history
  • Loading branch information
baekteun committed Oct 4, 2023
1 parent c4ed625 commit 6dbab9f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ final class MassageStore: BaseStore {
}

enum Action {
case viewDidLoad
case viewWillAppear
case fetchMassageRankList
}

Expand All @@ -40,8 +40,8 @@ final class MassageStore: BaseStore {
extension MassageStore {
func mutate(state: State, action: Action) -> SideEffect<Mutation, Never> {
switch action {
case .viewDidLoad:
return viewDidLoad()
case .viewWillAppear:
return viewWillAppear()

case .fetchMassageRankList:
return fetchMassageRankList()
Expand All @@ -66,7 +66,7 @@ extension MassageStore {

// MARK: - Mutate
private extension MassageStore {
func viewDidLoad() -> SideEffect<Mutation, Never> {
func viewWillAppear() -> SideEffect<Mutation, Never> {
return self.fetchMassageRankList()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ final class MassageViewController: BaseStoredViewController<MassageStore> {
}

override func bindAction() {
viewDidLoadPublisher
.map { Store.Action.viewDidLoad }
viewWillAppearPublisher
.map { Store.Action.viewWillAppear }
.sink(receiveValue: store.send(_:))
.store(in: &subscription)

Expand Down

0 comments on commit 6dbab9f

Please sign in to comment.