class Opal::TEA::Cmd

Overview

Represents an asynchronous side-effect or command in The Elm Architecture.

Defined in:

opal/tea/cmd.cr

Constructors

Instance Method Summary

Constructor Detail

def self.batch(cmds : Array(Cmd)) : Cmd #

Combines multiple commands into a single batched command


[View source]
def self.batch(*cmds : Cmd) : Cmd #

[View source]
def self.new(actions : Array( -> Msg | Nil) = [] of (-> Msg | ::Nil), quit : Bool = false) #

[View source]
def self.none : Cmd #

Empty command doing nothing


[View source]
def self.perform(&block : -> Msg | Nil) : Cmd #

Creates a command from a single background action returning a message


[View source]
def self.quit : Cmd #

Command that requests exiting the application loop


[View source]
def self.tick(interval : Time::Span, &block : Time -> Msg) : Cmd #

Produces a command that waits interval and then emits the message returned by block


[View source]

Instance Method Detail

def actions : Array( -> Msg | Nil) #

[View source]
def quit? : Bool #

[View source]