Rx\Observable::flatMapLatest PHP Method

flatMapLatest() public method

Transform the items emitted by an Observable into Observables, and mirror those items emitted by the most-recently transformed Observable. The flatMapLatest operator is similar to the flatMap and concatMap methods described above, however, rather than emitting all of the items emitted by all of the Observables that the operator generates by transforming items from the source Observable, flatMapLatest instead emits items from each such transformed Observable only until the next such Observable is emitted, then it ignores the previous one and begins emitting items emitted by the new one.
public flatMapLatest ( callable $selector, rx\SchedulerInterface $scheduler = null ) : Rx\Observable\AnonymousObservable
$selector callable - A transform function to apply to each source element.
$scheduler rx\SchedulerInterface
return Rx\Observable\AnonymousObservable - An observable sequence which transforms the items emitted by an Observable into Observables, and mirror those items emitted by the most-recently transformed Observable.
    public function flatMapLatest(callable $selector, SchedulerInterface $scheduler = null)
    {
        return $this->map($selector)->switchLatest($scheduler);
    }