module

Stream(T)

A suckless reactive stream toolkit.

Constructors

new

Creates and returns a stream.

Source

Instance 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.

Source
batch(count : Int32)

Emits objects from this stream in batches of count elements.

Source
each(func : T -> )

Calls func before emitting an object unchanged.

Source
each

Calls func before emitting an object unchanged.

Source
emit(object : T)

Emits object to all streams that are subscribed to this stream.

Source
forget(stream)

Unsubscribes stream from events in this stream.

Source
join(other : Stream(T))

Unordrered concatenation: emits objects from both streams.

Source
map

Emits an object transformed by func.

Source
notifies(stream)

Subscribes stream to this stream.

Source
reject

Emits only those objects for which func returns false.

Source
reject(pattern)

Emits only those objects that do not match against pattern (using ===).

Source
select

Emits only those objects for which func returns true.

Source
select(type : U.class) forall U

Emits only those objects that are of the given type.

Source
select(pattern)

Emits only those objects that match against pattern (using ===).

Source
uniq

Emits only if the result of func is not equal (==) to the last emitted value.

The first object is always emitted.

Source
uniq

Emits only if the emitted object is not equal to the previous emitted object.

Source
zip(other : Stream(U)) : Stream(Tuple(T, U)) forall U
Source