Last active
September 30, 2018 20:46
-
-
Save iby/94436c4c45c2d01d58590fee37420a06 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
class Foo: ReactiveExtensionsProvider { | |
let pipe = Signal<String, NoError>.pipe() | |
var bar: String = "Such bar!" { | |
didSet { self.pipe.input.send(value: self.bar) } | |
} | |
} | |
extension Reactive.Binds where Base: Foo { | |
var bar: BindingTarget<String> { | |
return self.reactive.makeBindingTarget({ $0.bar = $1 }) | |
} | |
} | |
extension Reactive.Signals where Base: Foo { | |
var bar: Signal<String, NoError> { | |
return self.base.pipe.output | |
} | |
} | |
extension Reactive.Producers where Base: Foo { | |
var bar: SignalProducer<String, NoError> { | |
return self.reactive.signal.bar.producer.prefix(value: self.base.bar) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment