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

Add LoadReceptionIdentity functor

parent 55578770
No related branches found
No related tags found
2 merge requests!102Release 1.0.0,!18Update Bindings
import Bindings
import XCTestDynamicOverlay
public struct LoadReceptionIdentity {
public var run: (String, Int) throws -> Data
public func callAsFunction(
key: String,
cmixId: Int
) throws -> Data {
try run(key, cmixId)
}
}
extension LoadReceptionIdentity {
public static let live = LoadReceptionIdentity { key, cmixId in
var error: NSError?
let data = BindingsLoadReceptionIdentity(key, cmixId, &error)
if let error = error {
throw error
}
guard let data = data else {
fatalError("BindingsLoadReceptionIdentity returned `nil` without providing error")
}
return data
}
}
extension LoadReceptionIdentity {
public static let unimplemented = LoadReceptionIdentity(
run: XCTUnimplemented("\(Self.self)")
)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment