Skip to content

Instantly share code, notes, and snippets.

@abdelmajidrajad
Last active May 12, 2020 11:15
Show Gist options
  • Save abdelmajidrajad/a7540abb5af9e83da4b6cb902fc22b76 to your computer and use it in GitHub Desktop.
Save abdelmajidrajad/a7540abb5af9e83da4b6cb902fc22b76 to your computer and use it in GitHub Desktop.
PF code snippet for xcode
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