Module Fmlib_browser.Command

Commands to be executed as a result of an update operation.

An elementary command consists of a Task to be executed.

type _ t

msg t is the type of a command generating an object of type msg to inject it into the update function of the application.

val none : _ t

An empty command.

val batch : 'm t list -> 'm t

batch lst A list of commands to be executed.

val perform : ('m, Task.empty) Task.t -> 'm t

perform task Perform the non failing task and send the message generated by the task to the application.

val just_do : (unit, Task.empty) Task.t -> 'm t

perform task Perform the non failing task and don't send any message to the application.

val attempt : (('a, 'e) Stdlib.result -> 'm) -> ('a, 'e) Task.t -> 'm t

attemp f task Attempt the possibly failing task and map the result via the function f into a message to send to the application.

val map : ('a -> 'b) -> 'a t -> 'b t