Example #1
0
        def create():
            def predicate(x):
                n[0] += 1
                if n[0] < 3:
                    return True
                else:
                    raise Exception(ex)

            return xs.pipe(ops.while_do(predicate))
Example #2
0
        def create():
            def predicate(x):
                n[0] += 1
                return n[0] < 100

            def subscribe(o, scheduler=None):
                o.on_next(1)
                o.on_completed()
                return lambda: None

            return reactivex.create(subscribe).pipe(ops.while_do(predicate))
Example #3
0
 def do_while(source: Observable[_T]) -> Observable[_T]:
     return source.pipe(ops.concat(source.pipe(
         ops.while_do(condition), ), ))
Example #4
0
 def create():
     return xs.pipe(ops.while_do(lambda _: True))
Example #5
0
        def create():
            def predicate(x):
                n[0] += 1
                return n[0] < 3

            return xs.pipe(ops.while_do(predicate))