RxPHP
RxPHP copied to clipboard
Allow merge/flatMap and variants to support arrays or iterator in addition to observables
Example:
->flatMap(function(array $x){
return $x;
})
From the subject of this issue I guess you mean something like this, @davidwdan right?
$sequence = Observable::fromArray([[1,2], [3,4], [5,6]]);
$sequence
->flatMap(static fn (array $items) => Observable::fromArray($items))
->do(static fn (int $item) => $io->note(sprintf('Item: %d', $item)))
->subscribe();
// prints:
// Item: 1
// Item: 2
// Item: 3
// Item: 4
// Item: 5
// Item: 6
Is that what you are looking for? Otherwise could you provide a more verbose example?