Skip to content

Commit

Permalink
[refactor] #133 Feature 내 Dependency 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
stealmh committed Oct 2, 2024
1 parent 9a5ea7d commit fbac2fe
Show file tree
Hide file tree
Showing 22 changed files with 86 additions and 63 deletions.
8 changes: 4 additions & 4 deletions Projects/App/Sources/AppDelegate/AppDelegateFeature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import KakaoSDKCommon

@Reducer
public struct AppDelegateFeature {
@Dependency(\.userNotifications) var userNotifications
@Dependency(\.remoteNotifications.register) var registerForRemoteNotifications
@Dependency(\.userDefaults) var userDefaults
@Dependency(UserNotificationClient.self) var userNotifications
@Dependency(RemoteNotificationsClient.self) var registerForRemoteNotifications
@Dependency(UserDefaultsClient.self) var userDefaults

@ObservableState
public struct State {
Expand Down Expand Up @@ -64,7 +64,7 @@ public struct AppDelegateFeature {
else { return }
default: return
}
await self.registerForRemoteNotifications()
await self.registerForRemoteNotifications.register()
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Projects/App/Sources/Intro/IntroFeature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import FeatureLogin
@Reducer
public struct IntroFeature {
/// - Dependency
@Dependency(\.userDefaults) var userDefaults
@Dependency(UserDefaultsClient.self) var userDefaults
/// - State
@ObservableState
public enum State {
Expand Down
6 changes: 3 additions & 3 deletions Projects/App/Sources/MainTab/MainTabFeature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import CoreKit
@Reducer
public struct MainTabFeature {
/// - Dependency
@Dependency(\.pasteboard)
@Dependency(PasteboardClient.self)
private var pasteBoard
@Dependency(\.categoryClient)
@Dependency(CategoryClient.self)
private var categoryClient
@Dependency(\.userDefaults)
@Dependency(UserDefaultsClient.self)
private var userDefaults
/// - State
@ObservableState
Expand Down
4 changes: 2 additions & 2 deletions Projects/App/Sources/Root/RootFeature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import CoreKit

@Reducer
public struct RootFeature {
@Dependency(\.userDefaults) var userDefaults
@Dependency(\.userClient) var userClient
@Dependency(UserDefaultsClient.self) var userDefaults
@Dependency(UserClient.self) var userClient
@Reducer(state: .equatable)
public enum Destination {

Expand Down
12 changes: 8 additions & 4 deletions Projects/App/Sources/Splash/SplashFeature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ import Util
@Reducer
public struct SplashFeature {
/// - Dependency
@Dependency(\.continuousClock) var clock
@Dependency(\.userDefaults) var userDefaults
@Dependency(\.authClient) var authClient
@Dependency(\.keychain) var keychain
@Dependency(\.continuousClock)
var clock
@Dependency(UserDefaultsClient.self)
var userDefaults
@Dependency(AuthClient.self)
var authClient
@Dependency(KeychainClient.self)
var keychain
/// - State
@ObservableState
public struct State: Equatable {
Expand Down
4 changes: 2 additions & 2 deletions Projects/CoreKit/Sources/CoreNetwork/TokenInterceptor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import Dependencies
/// AccessToken값을 헤더에 넣어주거나, refreshToken으로 Intercept해주는 Interceptor
public final class TokenInterceptor: RequestInterceptor {

@Dependency(\.keychain) var keychain
@Dependency(\.authClient) var authClient
@Dependency(KeychainClient.self) var keychain
@Dependency(AuthClient.self) var authClient

static let shared = TokenInterceptor()
private init() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ public struct CategoryDetailFeature {
/// - Dependency
@Dependency(\.dismiss)
private var dismiss
@Dependency(\.pasteboard)
@Dependency(PasteboardClient.self)
private var pasteboard
@Dependency(\.categoryClient)
@Dependency(CategoryClient.self)
private var categoryClient
@Dependency(\.contentClient)
@Dependency(ContentClient.self)
private var contentClient
@Dependency(\.kakaoShareClient)
@Dependency(KakaoShareClient.self)
private var kakaoShareClient
/// - State
@ObservableState
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ import Util
@Reducer
public struct PokitCategorySettingFeature {
/// - Dependency
@Dependency(\.dismiss) var dismiss
@Dependency(\.pasteboard) var pasteboard
@Dependency(\.categoryClient) var categoryClient
@Dependency(\.dismiss)
var dismiss
@Dependency(PasteboardClient.self)
var pasteboard
@Dependency(CategoryClient.self)
var categoryClient
/// - State
@ObservableState
public struct State: Equatable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ public struct CategorySharingFeature {
/// - Dependency
@Dependency(\.dismiss)
private var dismiss
@Dependency(\.categoryClient)
@Dependency(CategoryClient.self)
private var categoryClient
@Dependency(\.contentClient)
@Dependency(ContentClient.self)
private var contentClient

/// - State
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import DSKit
@Reducer
public struct ContentDetailFeature {
/// - Dependency
@Dependency(\.swiftSoup)
private var swiftSoup
@Dependency(\.dismiss)
private var dismiss
@Dependency(\.contentClient)
@Dependency(SwiftSoupClient.self)
private var swiftSoup
@Dependency(ContentClient.self)
private var contentClient
/// - State
@ObservableState
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ public struct ContentListFeature {
/// - Dependency
@Dependency(\.dismiss)
private var dismiss
@Dependency(\.pasteboard)
@Dependency(PasteboardClient.self)
private var pasteBoard
@Dependency(\.remindClient)
@Dependency(RemindClient.self)
private var remindClient
@Dependency(\.contentClient)
@Dependency(ContentClient.self)
private var contentClient
/// - State
@ObservableState
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ public struct ContentSettingFeature {
/// - Dependency
@Dependency(\.dismiss)
private var dismiss
@Dependency(\.swiftSoup)
@Dependency(SwiftSoupClient.self)
private var swiftSoup
@Dependency(\.pasteboard)
@Dependency(PasteboardClient.self)
private var pasteboard
@Dependency(\.contentClient)
@Dependency(ContentClient.self)
private var contentClient
@Dependency(\.categoryClient)
@Dependency(CategoryClient.self)
private var categoryClient
/// - State
@ObservableState
Expand Down
18 changes: 12 additions & 6 deletions Projects/Feature/FeatureLogin/Sources/Login/LoginFeature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@ import Util
@Reducer
public struct LoginFeature {
/// - Dependency
@Dependency(\.dismiss) var dismiss
@Dependency(\.socialLogin) var socialLogin
@Dependency(\.authClient) var authClient
@Dependency(\.userClient) var userClient
@Dependency(\.userDefaults) var userDefaults
@Dependency(\.keychain) var keychain
@Dependency(\.dismiss)
var dismiss
@Dependency(SocialLoginClient.self)
var socialLogin
@Dependency(AuthClient.self)
var authClient
@Dependency(UserClient.self)
var userClient
@Dependency(UserDefaultsClient.self)
var userDefaults
@Dependency(KeychainClient.self)
var keychain
/// - State
@ObservableState
public struct State {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import Util
public struct RegisterNicknameFeature {
/// - Dependency
@Dependency(\.dismiss) var dismiss
@Dependency(\.userClient) var userClient
@Dependency(\.mainQueue) var mainQueue
@Dependency(UserClient.self) var userClient
/// - State
@ObservableState
public struct State: Equatable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Util
public struct SelectFieldFeature {
/// - Dependency
@Dependency(\.dismiss) var dismiss
@Dependency(\.userClient) var userClient
@Dependency(UserClient.self) var userClient
/// - State
@ObservableState
public struct State: Equatable {
Expand Down
6 changes: 3 additions & 3 deletions Projects/Feature/FeaturePokit/Sources/PokitRootFeature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import Util
@Reducer
public struct PokitRootFeature {
/// - Dependency
@Dependency(\.categoryClient)
@Dependency(CategoryClient.self)
private var categoryClient
@Dependency(\.contentClient)
@Dependency(ContentClient.self)
private var contentClient
@Dependency(\.kakaoShareClient)
@Dependency(KakaoShareClient.self)
private var kakaoShareClient
/// - State
@ObservableState
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ public struct RemindFeature {
/// - Dependency
@Dependency(\.dismiss)
private var dismiss
@Dependency(\.remindClient)
@Dependency(RemindClient.self)
private var remindClient
@Dependency(\.contentClient)
@Dependency(ContentClient.self)
private var contentClient

/// - State
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ import CoreKit
@Reducer
public struct PokitAlertBoxFeature {
/// - Dependency
@Dependency(\.dismiss) var dismiss
@Dependency(\.pasteboard) var pasteboard
@Dependency(\.alertClient) var alertClient
@Dependency(\.dismiss)
var dismiss
@Dependency(PasteboardClient.self)
var pasteboard
@Dependency(AlertClient.self)
var alertClient
/// - State
@ObservableState
public struct State: Equatable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ public struct PokitSearchFeature {
private var dismiss
@Dependency(\.mainQueue)
private var mainQueue
@Dependency(\.pasteboard)
@Dependency(PasteboardClient.self)
private var pasteboard
@Dependency(\.userDefaults)
@Dependency(UserDefaultsClient.self)
private var userDefaults
@Dependency(\.contentClient)
@Dependency(ContentClient.self)
private var contentClient
/// - State
@ObservableState
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public struct FilterBottomFeature {
/// - Dependency
@Dependency(\.dismiss)
private var dismiss
@Dependency(\.categoryClient)
@Dependency(CategoryClient.self)
private var categoryClient
/// - State
@ObservableState
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import Util
public struct NickNameSettingFeature {
/// - Dependency
@Dependency(\.dismiss) var dismiss
@Dependency(\.userClient) var userClient
@Dependency(\.mainQueue) var mainQueue
@Dependency(UserClient.self) var userClient
/// - State
@ObservableState
public struct State: Equatable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,20 @@ import Util
@Reducer
public struct PokitSettingFeature {
/// - Dependency
@Dependency(\.dismiss) var dismiss
@Dependency(\.openSettings) var openSetting
@Dependency(\.pasteboard) var pasteboard
@Dependency(\.keychain) var keychain
@Dependency(\.userDefaults) var userDefaults
@Dependency(\.authClient) var authClient
@Dependency(\.openURL) var openURL
@Dependency(\.dismiss)
var dismiss
@Dependency(\.openURL)
var openURL
@Dependency(\.openSettings)
var openSetting
@Dependency(PasteboardClient.self)
var pasteboard
@Dependency(KeychainClient.self)
var keychain
@Dependency(UserDefaultsClient.self)
var userDefaults
@Dependency(AuthClient.self)
var authClient
/// - State
@ObservableState
public struct State: Equatable {
Expand Down

0 comments on commit fbac2fe

Please sign in to comment.