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.
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.
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.
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"
Represents the possible response states of a query.