Event
An event is a value which is defined in instantaneous moments at time.
In other words, from a denotational perspective it can be thought of as being equivalent to a List<Pair<Time, A>>
.
Visually, you can think of a time as a graph, where the x-axis is time, and the y-axis is the value of the events:
^
| *
| * *
| * * *
| * *
|---------------------------------->
For convenience, an Event is also a kotlinx.coroutines.flow.Flow, and so it can be collected on, but it may have slightly different behavior than most flows you are used to from kotlinx.coroutines such as kotlinx.coroutines.flow.MutableSharedFlow.
To use an Event idiomatically, you should avoid using collect unless absolutely necessary for your application -- and if necessary, collect should only be used at the "edges" of your application.
Conceptually, an Event can be viewed as a Signal
Inheritors
Functions
Method version of Signal.hold.
Builds a dirac impulse whose value is equal to the event values when the even has fired, and whole value is equal to zero otherwise