Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data sources rework #17

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

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.

None yet

2 participants