RxDataSources icon indicating copy to clipboard operation
RxDataSources copied to clipboard

Question: use of Binder in RxTableViewDataSourceType conformance.

Open apstygo opened this issue 6 years ago • 0 comments

Recently I started work on an Rx data source, using Apple's shiny new Diffable Data Source API. To learn more about how to create my own data source, conforming to RxTableViewDataSourceType, I read the implementation of RxTableViewSectionedReloadDataSource. But I can't wrap my head around the use of 'Binder' type.

Couldn't we just switched on observedEvent parameter and applied this new element whichever way we wanted? This binder object is not even retained, it's created every time a change occurs, which also seems counter-intuitive to me. But again, I'm probably missing the point.

It seems like 'Binder' is used here solely for the purpose of enforcing binding interface: crashing on errors and ignoring completes. Am I right?

I'm asking the question to decide whether or not to use this pattern in my own RxTableViewDataSourceType implementation. This could ultimately turn into a feature pull-request.

apstygo avatar Sep 30 '19 11:09 apstygo