Rx\Observable::takeWhile PHP Method

takeWhile() public method

Returns elements from an observable sequence as long as a specified condition is true. It takes as a parameter a a callback to test each source element for a condition. The callback predicate is called with the value of the element.
public takeWhile ( callable $predicate ) : Rx\Observable\AnonymousObservable
$predicate callable
return Rx\Observable\AnonymousObservable
    public function takeWhile(callable $predicate)
    {
        return $this->lift(function () use($predicate) {
            return new TakeWhileOperator($predicate);
        });
    }