Configuration for requests resulting in a Task
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 Cqrs.Query.QueryResponse e a.
The value contained within the Cqrs.Query.QueryResponse e a, will be the value parsed via the provided decoder.
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 Cqrs.Query.QueryResponse e a.
The value contained within the Cqrs.Query.QueryResponse e a, will be the value parsed via the provided decoder.
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 Cqrs.Query.QueryResponse e a.
This is useful for testing how your UI will respond to the happy path, without actually sending a query.
Constructs the Error variant of a Cqrs.Query.QueryResponse e a.
This is useful for testing how your UI will respond to the sad path, without actually sending a query.
Converts a Result e a to a Cqrs.Query.QueryResponse e a
Converts a given RemoteData x (Cqrs.Query.QueryResponse e a) into a Cqrs.Query.QueryResponse f a.
If a given Cqrs.Query.QueryResponse e a was successful, the data it contains will be returned.
data (Data []) --> Just []
data (Error "reason") --> NothingIf a given Cqrs.Query.QueryResponse e a 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 Cqrs.Query.QueryResponse e a and returns a Cqrs.Query.Response b.
Maps the Error variant of a given Cqrs.Query.QueryResponse e a.
Maps both the Data and the Error variant of a given Cqrs.Query.QueryResponse e a.
Convert a QueryResponse e a to an a by applying a function if the QueryResponse e a is a Data variant or using the provided default value if it is an Error variant.
Convert a QueryResponse e a to an a by applying either the first function if the QueryResponse e a is an Error variant or the second function if the QueryResponse e a is a Data variant.
Partitions a series of QueryResponse e a instances into a tuple of successful and unsuccessful responses.
When a given Cqrs.Query.QueryResponse e a is actually in the form Cqrs.Query.QueryResponse a a 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 e a 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 Cqrs.Query.QueryResponse e a to a Result e a
Converts a Cqrs.Query.QueryResponse e a to a Maybe a
Provides a default case for a Cqrs.Query.QueryResponse e a in place of the value held within the Error variant.
Checks if a given Cqrs.Query.QueryResponse e a is a Data variant.
succeeded (Data []) --> True
succeeded (Error "reason") --> FalseChecks if a given Cqrs.Query.QueryResponse e a is an Error variant.
failed (Data []) --> False
failed (Error "reason") --> TrueDecodes a given payload into a Cqrs.Query.QueryResponse e a.
Configuration for requests resulting in a
Cmd