Skip to content
Snippets Groups Projects
Commit e1462a9a authored by Dariusz Rybicki's avatar Dariusz Rybicki
Browse files

Add GetDependencies functor

parent 30cb7265
No related branches found
No related tags found
2 merge requests!102Release 1.0.0,!18Update Bindings
This commit is part of merge request !18. Comments created here will be created in the context of that merge request.
import Bindings
import XCTestDynamicOverlay
public struct GetDependencies {
public var run: () -> String
public func callAsFunction() -> String {
run()
}
}
extension GetDependencies {
public static let live = GetDependencies(run: BindingsGetDependencies)
}
extension GetDependencies {
public static let unimplemented = GetDependencies(
run: XCTUnimplemented("\(Self.self)")
)
}
import Bindings
public struct DependenciesProvider {
public var get: () -> String
public func callAsFunction() -> String {
get()
}
}
extension DependenciesProvider {
public static let live = DependenciesProvider(get: BindingsGetDependencies)
}
#if DEBUG
extension DependenciesProvider {
public static let failing = DependenciesProvider { fatalError("Not implemented") }
}
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment