generated from GSM-MSG/MSG-Repository-Generator
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ :: [#72] SplashFeature / SplashFactory 및 SplashFeature 사전세팅
- Loading branch information
Showing
5 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
Projects/Feature/SplashFeature/Sources/Factory/SplashFactory.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import BaseFeature | ||
import UIKit | ||
|
||
public protocol SplashFactory { | ||
func makeViewController() -> any StoredViewControllable | ||
} |
16 changes: 16 additions & 0 deletions
16
Projects/Feature/SplashFeature/Sources/Factory/SplashFactoryImpl.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import AuthDomainInterface | ||
import BaseFeature | ||
import UIKit | ||
|
||
final class SplashFactoryImpl: SplashFactory { | ||
private let checkIsLoggedInUseCase: any CheckIsLoggedInUseCase | ||
|
||
init(checkIsLoggedInUseCase: any CheckIsLoggedInUseCase) { | ||
self.checkIsLoggedInUseCase = checkIsLoggedInUseCase | ||
} | ||
|
||
func makeViewController() -> any StoredViewControllable { | ||
let store = SplashStore(checkIsLoggedInUseCase: checkIsLoggedInUseCase) | ||
return SplashViewController(store: store) | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
Projects/Feature/SplashFeature/Sources/Scene/SplashStore.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import AuthDomainInterface | ||
import BaseFeature | ||
import Combine | ||
import Moordinator | ||
import Store | ||
|
||
final class SplashStore: BaseStore { | ||
var route: PassthroughSubject<RoutePath, Never> = .init() | ||
var subscription: Set<AnyCancellable> = .init() | ||
var initialState: State | ||
var stateSubject: CurrentValueSubject<State, Never> | ||
private let checkIsLoggedInUseCase: any CheckIsLoggedInUseCase | ||
|
||
init(checkIsLoggedInUseCase: any CheckIsLoggedInUseCase) { | ||
initialState = .init() | ||
stateSubject = .init(initialState) | ||
self.checkIsLoggedInUseCase = checkIsLoggedInUseCase | ||
} | ||
|
||
struct State {} | ||
enum Action {} | ||
enum Mutation {} | ||
|
||
func mutate(state: State, action: Action) -> SideEffect<Mutation, Never> { | ||
.none | ||
} | ||
|
||
func reduce(state: State, mutate: Mutation) -> State { | ||
var newState = state | ||
return newState | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
Projects/Feature/SplashFeature/Sources/Scene/SplashViewController.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import BaseFeature | ||
import UIKit | ||
|
||
final class SplashViewController: BaseViewController<SplashStore> { | ||
} |
This file was deleted.
Oops, something went wrong.