Rx\Observable::concatMap PHP Method

concatMap() public method

Projects each element of an observable sequence to an observable sequence and concatenates the resulting observable sequences into one observable sequence.
public concatMap ( callable $selector, callable $resultSelector = null ) : Rx\Observable\AnonymousObservable
$selector callable A transform function to apply to each element from the source sequence onto. The selector is called with the following information: - the value of the element - the index of the element - the Observable object being subscribed
$resultSelector callable A transform function to apply to each element of the intermediate sequence. The resultSelector is called with the following information: - the value of the outer element - the value of the inner element - the index of the outer element - the index of the inner element
return Rx\Observable\AnonymousObservable - An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
    public function concatMap(callable $selector, callable $resultSelector = null)
    {
        return $this->lift(function () use($selector, $resultSelector) {
            return new ConcatMapOperator($selector, $resultSelector);
        });
    }