Created
March 6, 2018 18:43
-
-
Save lucasecf/8c200729dd48ca3d757285606d17d123 to your computer and use it in GitHub Desktop.
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
struct GetMoviesTask { | |
let dispatcher: AnyDispatcher<URLRequest, Data> | |
func load(success: ([Movie]) -> Void, failure: (Error) -> Void) { | |
let request = URLRequest(url: URL(string: “www.mydomain.com/movies")!) | |
dispatcher.execute(request: request, success: { (data) in | |
let movies = // (…) | |
success(movies) | |
}, failure: { error in | |
// (…) | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment