Skip to content

Instantly share code, notes, and snippets.

@IsaAliev
Created November 2, 2019 10:02
Show Gist options
  • Save IsaAliev/040c62fd66bd68a57a89e82176b2f8c7 to your computer and use it in GitHub Desktop.
Save IsaAliev/040c62fd66bd68a57a89e82176b2f8c7 to your computer and use it in GitHub Desktop.
import Foundation
import ReactiveKit
protocol Command: class, BindableProtocol {
func execute()
}
extension Command {
func bind(signal: Signal<Void, Never>) -> Disposable {
return signal.observeNext { [weak self] _ in
self?.execute()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment