API · Consume
valuesSync()
Collect a synchronous pipeline now, and fail immediately if any connected stage is asynchronous.
Signature
valuesSync(): T[] Example
const result = exstream([1, 2, 3])
.map((n) => n * 2)
.valuesSync()
// [2, 4, 6] Synchrony contract
Before consuming, Exstream walks the source chain. If any stage is asynchronous, it throws this stream is asynchronous. use .toPromise() instead of .valuesSync() without pretending the result is immediate. Async sources and operators such as resolve(), mapAsync(), generators, Node/Web streams, and makeAsync() trigger that path.
Successful synchronous output is returned in order. Context behavior inside callbacks is unchanged, but only values are returned.
Memory and errors
All values are retained until return. Record errors throw synchronously and stop collection. The call consumes the stream, so the same branch cannot later be attached to another consumer.
Forms
valuesSync() is instance-only:
stream.valuesSync()