-
Notifications
You must be signed in to change notification settings - Fork 16
Stats: fetching clicks / referrer #97
Conversation
|
|
||
| self.title = title | ||
| self.clicksCount = clicksCount | ||
| self.clickedURL = urlString.flatMap { URL(string: $0) } |
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 recognize why we'd use flatMap on a collection. It appears that the benefit in this case is to handle the optionality of icon & urlString, correct?
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.
Exactly! It saves us doing something like:
let clickedURL: URL?
if let urlString = urlString {
clickedURL = URL(string: urlString)
} else {
clickedURL = nil
}Just a bit of syntactic sugar.
| public let period: StatsPeriodUnit | ||
| public let periodEndDate: Date | ||
|
|
||
| public let totalReferrerViews: Int |
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.
In ClicksStatsType, there appears to be an analogous property called totalClicksCount. Is this worth renaming to totalViewsCount or totalRefererredViewsCount for consistency with that and StatsReferrer (viewsCount) below?
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.
Yup, absolutely! Thanks for catching that!
| public let periodEndDate: Date | ||
|
|
||
| public let totalReferrerViews: Int | ||
| public let otherReferrerViews: Int |
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.
If we embrace the suggestion above, it is also applicable here.
ghost
left a comment
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.
@jklausa thanks for sharing this with me. The branch builds & tests pass! The code looks good to me.
I have shared a few comments for your consideration, but none of them absolutely require a change.
|
@jklausa I just noted that the hash in |
Description
Adds support for fetching clicks and referrer data.
They're so similar in shape I took the liberty of grouping them both in one PR
Testing Details