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
public enum VanillaRequestError: Error | |
{ | |
case unexpectedResult(String) | |
case restfulError(NSError) | |
} | |
// the result from a Vanilla API request | |
public enum VanillaRequestResult<T> | |
{ | |
case success(T) | |
case failure(VanillaRequestError) | |
} | |
// variant that expects a single T | |
internal func responseProcessingDataTask<T: JSONInitializable>(_ request: URLRequest, resultsKey: String? = nil, completion: ((VanillaRequestResult<T>)->())?) -> URLSessionDataTask | |
{ | |
} | |
// variant that expects an array of T | |
internal func responseProcessingDataTask<T: JSONInitializable>(_ request: URLRequest, resultsKey: String? = nil, completion: ((VanillaRequestResult<[T]>)->())?) -> URLSessionDataTask | |
{ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment