-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainPageFeature.swift
45 lines (37 loc) · 1.08 KB
/
MainPageFeature.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//
// MainPageFeature.swift
// Features
//
// Created by 이영빈 on 2023/08/10.
// Copyright © 2023 team.humanwave. All rights reserved.
//
import Foundation
import ComposableArchitecture
import Core
public struct MainPageFeature: Reducer {
public struct State: Equatable {
@Box var home: HomeFeature.State
@Box var myPage: MyPageFeature.State
var view: View = .none
enum View: Equatable { case none }
public init(userId: Int, nickname: String) {
self._home = .init(.init(nickname: nickname))
self._myPage = .init(.init(userId: userId, nickname: nickname))
}
}
public enum Action {
case home(HomeFeature.Action)
case myPage(MyPageFeature.Action)
}
public var body: some Reducer<State, Action> {
Scope(state: \.home, action: /Action.home) {
HomeFeature()
}
Scope(state: \.myPage, action: /Action.myPage) {
MyPageFeature()
}
Reduce { _, _ in
return .none
}
}
}