Closed clayellis closed 6 years ago
We had talked on Discord about potentially changing instances of pageSize
to match the new perPage
wording. How do you feel about moving forward on that? Or is it unnecessary.
Yeah, I say change the pageSize
to better match the style we are after here. Definitely makes more sense to keep everything matching and organized that pertains to each other.
I've gone ahead and merged this. 👍
Awesome, I'll open another PR with the other wording changes.
Swiftlint was being a pain in the ass so had to fix all of that. But sounds good.
In order to increase clarity and consistency, I propose changing the parameter label
key
topageKey
in thepaginate
methods.Motivation
The Swift API Design Guidelines urges us to "Include all the words needed to avoid ambiguity". By changing
key
topageKey
we remove any ambiguity about whatkey
is — specifically that it is the page key in the query.This also increases consistency throughout the code since everywhere else (see:
Pagination.defaultPageKey
) this key is referred to as thepageKey
.Breaking Change?
Potentially, but not drastic. Since the parameter is provided a default value, unless a user has specified the
key
parameter, there won't be any breaking changes. If, however, they have specifiedkey
the compiler can automatically suggest the renamed parameter label which makes upgrading trivial.