Configuration for requests resulting in a Task
Represents the response state of a query.
Represents the default inner data type of an Error variant.
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.Response a.
The value contained within the Cqrs.Query.Response 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.Response a.
The value contained within the Cqrs.Query.Response 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.Response 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.Response a.
This is useful for testing how your UI will respond to the sad path, without actually sending a query.
Maps the Data variant of a given Cqrs.Query.Response a and returns a Cqrs.Query.Response b.
Maps the Error variant of a given Cqrs.Query.Response a.
Provides a default case for a Cqrs.Query.Response in place of the value held within the Error variant.
Checks if a given Cqrs.Query.Response is a Data variant.
succeeded (Data []) --> True
succeeded (Error "reason") --> FalseChecks if a given Cqrs.Query.Response is an Error variant.
failed (Data []) --> False
failed (Error "reason") --> TrueIf a given Cqrs.Query.Response was successful, the data it contains will be returned.
data (Data []) --> Just []
data (Error "reason") --> NothingIf a given Cqrs.Query.Response was unsuccessful, the reason for the failure will be returned.
reason (Data []) --> Nothing
reason (Error "reason") --> Just "reason"Decodes a given payload into a Cqrs.Query.Response a.
Configuration for requests resulting in a
Cmd