## Documentation
npm install most-adjunctNote: All functions in most-adjunct are curried.
* concatArray
* fromEagerPromise
* fromFuture
* ignoreElements
* last
* mapError
* range
* switchMap
* tapError
* toArray
concatArray(arr: Array): Stream Array variant of most.concat, allowing you to concatenate many streams together.
fromEagerPromise(f(): Promise): StreamThe problem with fromPromise is that promises are eager, and therefore it would have already executed prior to being subscribed to. This function creates a lazy stream version of the promise.
fromFuture(future: Future): StreamConverts a future into a stream.
ignoreElements(stream: Stream): StreamIgnore any further elements. Do not emit any more items in this stream. This does not complete the stream.
last(stream: Stream): StreamEmits only the last item emitted on the stream (once the inner stream has completed).
Example:
``js
const stream = most
.from([1, 2, 3])
.thru(mA.last);
stream.observe({
next: console.log,
});
// -> 3
```
a: -1-2-3-|
stream: -----3-|
If the stream errors this function will allow you to transform the error (via mapping) without recovering the error (catching).
This is useful in situations whereby you have an underlying internal error that you want to make into a human readable error.
$3
range(start: Number, end: Number): StreamCreate a stream of numbers from start to end.
Example:
`js
const stream = mA.range(1, 3);stream.observe({
next: console.log,
});
// -> 1
// -> 2
// -> 3
`$3
switchMap(f: (x: any): Stream, stream: Stream): StreamA composition of
map + switchLatest. Will automatically subscribe to the inner stream that is mapped out.$3
tapError(f(x: any): void, stream: Stream): StreamThe same as
most.tap excepts it allows for tapping of items in the error state.$3
toArray(stream: Stream): StreamAccumlates all of the items emitted and emits an array of all of those items.
None of the original items are emitted on this new stream.
Example:
`js
const stream = most
.from([1, 2, 3])
.thru(mA.toArray);stream.observe({
next: console.log,
});
// -> [1, 2, 3]
`$3
waitUntil(f: (): boolean | PromiseCreates a Stream that will only start emitting events when the predecate function returns true.
Example:
`js
waitUntil(() => returnTrueOrFalse(), 1000)
.map(() => {});
``