-
Notifications
You must be signed in to change notification settings - Fork 3
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
Rename all references from ViewModel to Item #20
Conversation
describe("ViewModel") { | ||
var viewModel: ViewModel! | ||
describe("Item") { | ||
var Item: Item! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the variable name should be lowercase 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I's weird that it compiles 😱
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm gonna check it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vadymmarkov it didn't compile when running the tests :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it should build the tests when calling build
instead of just when the tests run. That would avoid these kind of things.
@vadymmarkov @onmyway133 @RamonGilabert yay, the tests pass! |
@@ -2,7 +2,7 @@ import Tailor | |||
|
|||
// MARK: - Array | |||
|
|||
public extension _ArrayType where Generator.Element == ViewModel { | |||
public extension _ArrayType where Generator.Element == Item { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does making extension on slightly private type
good practice?
} | ||
|
||
it("compare relations properly") { | ||
var Item2 = Item(data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small detail, but it would be great if the variable is lowercase 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True dat!
This is a breaking change, it renames the
ViewModel
struct toItem
andViewConfigurable
toItemConfigurable
.It should be very easy to migrate to the new version as you only need to search and replace those changes and should be done in a jiffy.
This PR came to be after a discussion that me and @vadymmarkov had about naming.
ViewModel
kind of implies that it holds content for the entire screen as it would potentially deal withViewController
.And the second reason is that it is mainly used in
Spots
where we always refer to theViewModel
as anItem
.Item
is abstract to work on multiple instances, where asViewModel
implies a specific scenario where it will be used. You can always argue that it is in fact styling a specific view asViewConfigurable
is a property on the underlaying component, a cell for example.Personally I think this is the best name for what it does. I hope you do as well.