-
Notifications
You must be signed in to change notification settings - Fork 17
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
Renaming NetworkRequest protocol? #36
Comments
I like the idea a lot, my only reservation is moving away from the example of the standard library with AnyHashable. I can be convinced either way. |
Yeah, I've thought about that too. Apple has kind of made "Any" the standard here. Maybe even shortening to |
I could get on board with that. |
Is this something we want to try and include for 2.0? |
I think so. I'd like more people to weigh-in with their thoughts though. |
I could get onboard with dropping the "Any". |
So far I'm leaning towards:
Anyone else have any opinions? @BottleRocketStudios/ios-developers |
To provide a bit of pushback, I believe the intended purpose is to differentiate naming a specific, concrete implementation of a protocol from the general idea of the protocol. I do agree that seeing It seems like above we're moving towards calling out the protocols instead of the concrete implementations. Could make a lot of sense. |
I agree with renaming to For the "Any" request, I vote for |
I'm going to play devil's advocate here and suggest the following (taking the API naming guidelines into account strictly):
|
I like the idea of: Apple seems pretty consistent with their naming of type-erased values and I think retaining that consistency is a good idea. |
@tylermilner Do you think we have consensus to move forward? It looks to me like:
|
@wmcginty Yeah, I think that's what we'll do. AFAIK, that should be one of the last changes that we need to release |
Under review in #52 |
Merged in #52 |
I've been thinking about this for a while and wanted to open up discussion. I've personally never really been a fan of the
Any...<T>
convention used for type-erased structs. Instead ofAnyNetworkRequest<T>
, I think it would be nicer to be able to just writeNetworkRequest<T>
. To accomplish this, we would need to rename theNetworkRequest
protocol to something else. Some ideas I have are:RequestRepresentable
NetworkRequestRepresentable
NetworkRequestProtocol
This would of course be a breaking change so it'd likely go into a
2.0.0
release. See the examples below for a peak of how this might look.Defining something that conforms to
RequestRepresentable
:Using
NetworkRequest<T>
:The text was updated successfully, but these errors were encountered: