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

[Fix] Make section and cell view models diffable by default #119

Merged
merged 2 commits into from
Jul 9, 2018

Conversation

jessesquires
Copy link
Contributor

  • Section and cell view models are now diffable by default.
    They have default values for diffingKey, but clients should be customizing these for their needs.
    • CollectionSectionViewModel protocol now inherits from DiffableViewModel protocol
    • CollectionCellViewModel protocol now inherits from DiffableViewModel protocol
    • TableSectionViewModel protocol now inherits from DiffableViewModel protocol
    • TableCellViewModel protocol now inherits from DiffableViewModel protocol

Closes #114

- Section and cell view models are now diffable by default.
They have default values for `diffingKey`, but clients should be customizing these for their needs.
    - `CollectionSectionViewModel` protocol now inherits from `DiffableViewModel` protocol
    - `CollectionCellViewModel` protocol now inherits from `DiffableViewModel` protocol
    - ` TableSectionViewModel` protocol now inherits from `DiffableViewModel` protocol
    - `TableCellViewModel` protocol now inherits from `DiffableViewModel` protocol

Closes #114
@PlanBot-iOS
Copy link

PlanBot-iOS commented Jul 6, 2018

1 Warning
⚠️ All pull requests should have a milestone attached

Generated by 🚫 Danger

asmallteapot
asmallteapot previously approved these changes Jul 7, 2018
Copy link

@asmallteapot asmallteapot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the approach of defaulting to UUIDs

@jessesquires
Copy link
Contributor Author

@asmallteapot Yeah, I wanted this to be non-optional (also required by the DiffableViewModel protocol) and that seemed like the only reasonable thing to do.

CHANGELOG.md Outdated
### Changed

- Section and cell view models are now diffable by default. ([#119](https://github.com/plangrid/ReactiveLists/pull/119), [@jessesquires](https://github.com/jessesquires))
Each provide default values for `diffingKey`, but you should be customize them for your own needs or opt-out of automatic diffing.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"but you should be" -> "but you can"

@jessesquires jessesquires merged commit d513452 into master Jul 9, 2018
@jessesquires jessesquires deleted the jsq/fix-114 branch July 9, 2018 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants