Skip to content

Commit bf0ce08

Browse files
author
Ernesto Carrión
committed
Prefer specific Constants enum over extending Default one
1 parent 2bba6e8 commit bf0ce08

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Yosemite/Yosemite/Stores/ProductCategoryStore.swift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ private extension ProductCategoryStore {
3939
///
4040
func synchronizeAllProductCategories(siteID: Int64, fromPageNumber: Int, onCompletion: @escaping (ProductCategoryActionError?) -> Void) {
4141
// Start fetching the provided initial page
42-
synchronizeProductCategories(siteID: siteID, pageNumber: fromPageNumber, pageSize: Default.maxPageSize) { [weak self] categories, error in
42+
synchronizeProductCategories(siteID: siteID, pageNumber: fromPageNumber, pageSize: Constants.defaultMaxPageSize) { [weak self] categories, error in
4343
guard let self = self else {
4444
return
4545
}
@@ -142,8 +142,12 @@ private extension ProductCategoryStore {
142142
}
143143
}
144144

145-
// MARK: - Default
145+
// MARK: - Constant
146146
//
147-
private extension Store.Default {
148-
static let maxPageSize = 100 // Max number allwed by the API to maximize our changces on getting all items in one request.
147+
private extension ProductCategoryStore {
148+
enum Constants {
149+
/// Max number allwed by the API to maximize our changces on getting all item in one request.
150+
///
151+
static let defaultMaxPageSize = 100
152+
}
149153
}

0 commit comments

Comments
 (0)