A suckless reactive stream toolkit.
Constructors
new
Creates and returns a stream.
SourceInstance methods
all(from a :
Stream(
M), until b :
Stream(
K), now = false) forall
M,
K Starts to emit when a emits, and stops to emit when b
emits. now can be passed to skip waiting for a to emit
the first time.
Sourcebatch(count : Int32)
Emits objects from this stream in batches of count elements.
Sourceeach(func : T -> )
Calls func before emitting an object unchanged.
Sourceeach
Calls func before emitting an object unchanged.
Sourceemit(object : T)
Emits object to all streams that are subscribed to this stream.
Sourceforget(stream)
Unsubscribes stream from events in this stream.
SourceUnordrered concatenation: emits objects from both streams.
Sourcemap
Emits an object transformed by func.
Sourcenotifies(stream)
Subscribes stream to this stream.
Sourcereject
Emits only those objects for which func returns false.
Sourcereject(pattern)
Emits only those objects that do not match against
pattern (using ===).
Sourceselect
Emits only those objects for which func returns true.
Sourceselect(type : U.class) forall U
Emits only those objects that are of the given type.
Sourceselect(pattern)
Emits only those objects that match against pattern
(using ===).
Sourceuniq
Emits only if the result of func is not equal (==)
to the last emitted value.
The first object is always emitted.
Sourceuniq
Emits only if the emitted object is not equal to the
previous emitted object.
Source