Add a parameter: UI.bind(self) { me, state in ... }
beeth0ven opened this issue · 1 comments
beeth0ven commented
Hi thanks for provide the simplest architecture for RxSwift with RxFeedback,
I've a small question, is it good to add a strongify self parameter like what UIBindingObserver
dose.
This can avoid let label = self.label!
:
//let label = self.label!
//let minus = self.minus!
//let plus = self.plus!
Observable.system(
...
feedback:
UI.bind(self) { me, state -> UI.Bindings<Event> in
let subscriptions = [
state.map(String.init).bind(to: me.label.rx.text)
]
let events = [
me.plus.rx.tap.map { Event.increment },
me.minus.rx.tap.map { Event.decrement }
]
return UI.Bindings(subscriptions: subscriptions, events: events)
}
)
.subscribe()
.disposed(by: disposeBag)
kzaher commented
Hi @beeth0ven ,
yeah, sure. Feel free to make a PR with another overload.