Configuration for requests resulting in a Task
Configuration settings for a request
Configuration settings for a requestWithConfig
Configuration settings for a requestTask
Configuration settings for a requestTaskWithConfig
Represents the possible types of query which can be executed depending on your needs.
Represents the possible states of a query.
Sends a query to the given URL and returns a Cmd for the given msg containing the parsed QueryResponse error data.
Similar to request but a StandardRequestConfig can be passed in for cases where customisation of the request headers, etc are desired.
Sends a query to the given URL and returns a Task which will contain the parsed QueryResponse error data.
Similar to requestTask but a TaskRequestConfig can be passed in for cases where customisation of the request headers, etc are desired.
Constructs the Data variant of a QueryResponse error data.
This is useful for testing how your UI will respond to the happy path, without actually sending a query, for example.
Constructs the Error variant of a QueryResponse error data.
This is useful for testing how your UI will respond to the sad path, without actually sending a query, for example.
Converts a Result error data to a QueryResponse error data
Converts a given WebData (QueryResponse issue data) into a QueryResponse error data.
If a given QueryResponse error data was successful, the data it contains will be returned.
data (Data []) --> Just []
data (Error "reason") --> NothingIf a given QueryResponse error data was unsuccessful, the reason for the failure will be returned.
reason (Data []) --> Nothing
reason (Error "reason") --> Just "reason"Maps the Data variant of a given QueryResponse error data.
Maps the Error variant of a given QueryResponse error data.
Maps both the Data and the Error variant of a given QueryResponse error data.
Convert a QueryResponse error data to a value by applying a function if the QueryResponse error data is a Data variant or using the provided default value if it is an Error variant.
Convert a QueryResponse error data to a value by applying either the first function if the QueryResponse error data is an Error variant or the second function if the QueryResponse error data is a Data variant.
Partitions a series of QueryResponse error data instances into a tuple of successful and unsuccessful responses.
When a given QueryResponse error data is actually in the form QueryResponse value value then we can return the underlying value from either state. This is especially useful when the error and value have been mapped to domain types.
Filter a given QueryResponse error data if it is in the Data variant and should the predicate not pass, map to a Error variant with the given error. Useful for error value mapping within a given domain.
Converts a QueryResponse error data to a Result error data
Converts a QueryResponse error data to a Maybe data
Provides a default case for a QueryResponse error data in place of the value held within the Error variant.
Checks if a given QueryResponse error data is a Data variant.
succeeded (Data []) --> True
succeeded (Error "reason") --> FalseChecks if a given QueryResponse error data is an Error variant.
failed (Data []) --> False
failed (Error "reason") --> TrueDecodes a given payload into a QueryResponse error data.
Configuration for requests resulting in a
Cmd