Skip to content

Conversation

@Granfalloner
Copy link
Collaborator

@Granfalloner Granfalloner commented Feb 17, 2018

This pull request changes iOS RxRealmDataSources implementation slightly to align with and leverage functionality already present in RxCocoa.

@icanzilb
Copy link
Member

interesting! I'll give it a try this week 👌

@Granfalloner
Copy link
Collaborator Author

@icanzilb, one clarification needs to be made - this PR, although done separately, is closely related to another my PR (SectionedViewDataSourceTypeConformance). They both provide full interoperability with RxCocoa-provided mechanisms (and in fact, this PR depends somewhat on previous). Maybe it would have been better to make one bigger pull request, but I wanted to keep scope of changes smaller in each case.

If you accept this PRs, it make sense to provide new release, as they are good improvements to the library. To ease transition, I kept old interfaces, but added deprecation notice. Although some methods signatures changed (realmChanges), already written code like this:

Observable.changes(...)
    .bind(to: tableView.rx.realmChanges(dataSource))
    .disposed(by: bag)

tableView.rx.realmModelSelected(String.self)
     .bind(to: label.rx.title)
     .disposed(by: bag)

will compile and continue working (note that realmModelSelected depends on SectionedViewDataSourceTypeConformance).

…w delegates. It eliminates the need to manually reimplement functionality already present in RxCocoa (like modelSelected, modelDeselected, etc).
…st importantly, leveraging underlying DelegateProxy mechanism. This has multiple benefits: allows to use standard RxCocoa binding interface instead of writing our own; and brings functionality that otherwise was broken (like observing dataSource method invocations).
… show functionality that wasn't possible before (e.g., it was not possible to observe itemDeleted in previous implementation).
@Granfalloner
Copy link
Collaborator Author

Hi @icanzilb !
I've updated slightly my long-awaiting PR (combined 2 dependant PRs into one along with small changes to macOS version).
Can you please have a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants