Configuration for requests resulting in a Task
Represents the possible states of a command.
Sends a command to the given URL with the provided body and returns a parsed Cqrs.Command.CommandResponse e in turn.
Similar to request but a StandardRequestConfig can be passed in for cases where customisation of the request headers, etc are desired.
Sends a command to the given URL and returns a Task containing the parsed Cqrs.Command.CommandResponse e.
The value contained within the Cqrs.Command.CommandResponse e, 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 Succeeded variant of a Cqrs.Command.CommandResponse e.
This is useful for testing how your UI will respond to the happy path, without actually sending a command.
Constructs the Failed variant of a Cqrs.Command.CommandResponse e.
This is useful for testing how your UI will respond to the sad path, without actually sending a command.
Converts a Result e a to a Cqrs.Command.CommandResponse e
Converts a given RemoteData x (CommandResponse e) into a Cqrs.Command.CommandResponse e.
If a given Cqrs.Command.CommandResponse e was unsuccessful, the reason for the failure will be returned.
reason Succeeded --> Nothing
reason (Failed "reason") --> Just "reason"Maps the Failed variant of a given Cqrs.Command.CommandResponse e.
Convert a CommandResponse e to an a by applying a function if the CommandResponse e is a Succeeded variant or using the provided default value if it is an Failed variant.
Convert a CommandResponse e to an a by applying either the first function if the CommandResponse e is an Failed variant or the second function if the CommandResponse e is a Succeeded variant.
Partitions a series of CommandResponse e instances into a tuple of successful and unsuccessful responses.
Converts a Cqrs.Command.CommandResponse e to a Result e a
Converts a Cqrs.Command.CommandResponse e to a Maybe a
Checks if a given Cqrs.Command.CommandResponse e is a Succeeded variant.
succeeded Succeeded --> True
succeeded (Failed "reason") --> FalseChecks if a given Cqrs.Command.CommandResponse e is a Failed variant.
failed Succeeded --> False
failed (Failed "reason") --> TrueDecodes a given payload into a Cqrs.Command.CommandResponse e.
Configuration for requests resulting in a
Cmd