Closed fenuks closed 5 years ago
This is supported out of the box using the inputs observer, like so:
let exampleAction: Action<(Int, Int, Int), (Int, Int, Int)> = Action { (a, b, c) in Observable.just((a+1, b+1, c+1)) }
Observable.just((1, 2, 3)).bind(to: exampleAction2.inputs).disposed(by: disposeBag)
Thank you, that's very clean way of doing it. 👍 I will migrate to this solution in my code.
I quickly skimmed through the code, and it seems that Observable cannot be bind to an
Action
, I couldn't find related issues as well.It would be useful, e.g. when using
Observable.combineLatest
to bindObservable
toAction
. Simple example to illustrate that.It is not difficult to write extension for
ObservatleType
to allow such use-case.Are there any reasons for this not being possible out-of-box?