Created
March 4, 2018 22:01
-
-
Save lucasecf/bba6d8379de06ccd27e9cff9820dfad4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 AnyDispatcher<R, O>: Dispatcher { | |
private let _execute: (R, (O) -> Void, (Error) -> Void) -> Void | |
init<D: Dispatcher>(_ dispatcher: D) where R == D.Request, O == D.Output { | |
_execute = dispatcher.execute | |
} | |
func execute(request: R, success: (O) -> Void, failure: (Error) -> Void) { | |
_execute(request, success, failure) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment