Last active
May 12, 2020 11:15
-
-
Save abdelmajidrajad/a7540abb5af9e83da4b6cb902fc22b76 to your computer and use it in GitHub Desktop.
PF code snippet for xcode
This file contains hidden or 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
import ComposableArchitecture | |
//MARK:- State | |
public struct <#Domain#>State: Equatable {} | |
//MARK:- Action | |
enum <#Domain#>Action: Equatable { | |
case newAction | |
} | |
//MARK:- Environment | |
public struct <#Domain#>Environment { | |
let mainQueue: AnySchedulerOf<DispatchQueue> | |
} | |
extension <#Domain#>Environment { | |
public static let mock = <#Domain#>Environment( | |
mainQueue: DispatchQueue.main.eraseToAnyScheduler() | |
) | |
} | |
//MARK:- Reducer | |
let <#Domain#>Reducer: | |
Reducer<<#Domain#>State, <#Domain#>Action, <#Domain#>Environment> = | |
Reducer { state, action, environment in | |
switch action { | |
case .newAction: | |
return .none | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment