most-combine-as-array

Combine an array of streams as an array

Usage no npm install needed!

<script type="module">
  import mostCombineAsArray from 'https://cdn.skypack.dev/most-combine-as-array';
</script>

README

@blrrt/most-combine-as-array

combineAsArray(f, arrayOfStreams) -> Stream

Combine an array of streams. Unlike most.combineArray, this will work on empty arrays and also return an array (as you'd expect) instead of a list of arguments.

Usage

import _identity from 'lodash/fp/identity';
import { of } from 'most';

const input$ = [
  of('foo'),
  of('bar'),
  of('baz'),
];

const output$ = combineAsArray(_identity, input$);

// ['foo', 'bar', 'baz']
output$.subscribe({
  next: x => console.log(x),
});