Utilities to delay updates after a set period of time
Starts a sequence of messages given the SequenceMsg and a list of messages to be sent
type Msg
= FirstMsg
| SecondMsg
| ThirdMsg
| Sequence (List ( Float, Msg ))
-- triggers each Msg one after the other with a 500ms delay
start Sequence
[ (500, FirstMsg)
, (500, SecondMsg)
, (500, ThirdMsg)
]Starts a sequence if a predicate value is True. This is helpful if you'd like to start the sequence only if your model is in a particular shape
startIf (not model.updating) Sequence
[ (500, FirstMsg)
, (500, SecondMsg)
, (500, ThirdMsg)
]Calls update with each message and a delay until finished.
-- recursively calls update until all Msgs have been processed
Sequence msgs ->
handleSequence Sequence update model
Delays an update (with a message) by a given number of milliseconds