Skip to content

Commit 4285d7a

Browse files
committed
refactor: Home 데이터 fetch 액션명 정리
1 parent c0a2ace commit 4285d7a

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

Application/DevLogPresentation/Sources/Home/Home/HomeViewCoordinator.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ final class HomeViewCoordinator {
4545
)
4646
}
4747

48-
func loadInitialData() {
49-
viewModel.send(.loadInitialData)
48+
func fetchData() {
49+
viewModel.send(.fetchData)
5050
}
5151

5252
func makeTodoManageViewModel() -> TodoManageViewModel {

Application/DevLogPresentation/Sources/Home/Home/HomeViewModel.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ final class HomeViewModel: Store {
3838
}
3939

4040
enum Action {
41-
case loadInitialData
41+
case fetchData
4242
case networkStatusChanged(Bool)
4343
case setPresentation(Presentation, Bool)
4444
case setAlert(isPresented: Bool, type: AlertType? = nil)
@@ -145,7 +145,7 @@ final class HomeViewModel: Store {
145145
switch action {
146146
case .networkStatusChanged(let isConnected):
147147
state.isNetworkConnected = isConnected
148-
case .loadInitialData, .setPresentation, .setAlert, .setToast, .refreshWebPages,
148+
case .fetchData, .setPresentation, .setAlert, .setToast, .refreshWebPages,
149149
.tapTodoCategory, .orderTodoCategory, .addTodo, .updateWebPageURLInput,
150150
.addWebPage, .deleteWebPage, .undoDeleteWebPage:
151151
effects = reduceByView(action, state: &state)
@@ -274,7 +274,7 @@ private extension HomeViewModel {
274274
// swiftlint:disable cyclomatic_complexity
275275
func reduceByView(_ action: Action, state: inout State) -> [SideEffect] {
276276
switch action {
277-
case .loadInitialData:
277+
case .fetchData:
278278
return [.fetchTodoCategoryPreferences, .fetchRecentTodos, .fetchWebPages]
279279
case .refreshWebPages:
280280
return [.fetchWebPages]

Application/DevLogPresentation/Sources/Main/MainView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ struct MainView: View {
4343
}
4444
.onChange(of: selectedTab, initial: true) { _, newValue in
4545
if newValue == .home {
46-
homeViewCoordinator.loadInitialData()
46+
homeViewCoordinator.fetchData()
4747
} else if newValue == .today {
4848
todayViewCoordinator.fetchData()
4949
}

0 commit comments

Comments
 (0)