Protocol
SimpleNetworkLoader
public protocol SimpleNetworkLoader: Loader
A type that can load data from over the network and throw errors.
Relationships
Conforms To
LoaderA type that can load data from a source and throw errors.
Requirements
createRequest(for:)
func createRequest(for key: Key) -> URLRequest
Creates a URLRequest for a network loading request.
Parameters
| Name | Type | Description |
|---|---|---|
| key | Key |
The key identifying the object to load. |
decode(_:key:)
func decode(_ data: Data, key: Key) throws -> Object
Decodes data received from a network request into the object.
Parameters
| Name | Type | Description |
|---|---|---|
| data | Data |
The data received from the request. |
| key | Key |
The key identifying the object to load. |