Created
April 4, 2016 08:56
-
-
Save blinker13/241111b73338e8aca2d11e9d3fbea3e6 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
public protocol Command { | |
associatedtype Input | |
associatedtype Output | |
func execute(input:Input) -> Output | |
} | |
public final class Signal<Input, Output> : Command { | |
private let block:(Input) -> Output | |
public init(_ block:(Input) -> Output) { | |
self.block = block | |
} | |
public func execute(input:Input) -> Output { | |
return block(input) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment