def create(): return xs.pipe(ops.contains(42))
def create(): return xs.pipe(ops.contains(21, lambda a, b: a % 2 == b % 2))
# ... """Error Handling""" op.catch() op.retry() """Utility""" op.delay() op.materialize() op.time_interval() op.timeout() op.timestamp() """Conditional and Boolean""" op.all() op.contains() op.default_if_empty() op.sequence_equal() op.skip_until() op.skip_while() op.take_until() op.take_while() """Connectable""" op.publish() op.ref_count() op.replay() """Combining""" op.combine_latest() op.merge()
def create(): def comparer(a, b): raise Exception(ex) return xs.pipe(ops.contains(42, comparer))
import rx import rx.operators as ops numbers = rx.from_([1, 2, 3, 4]) numbers.pipe(ops.contains(3)).subscribe( on_next=lambda i: print("on_next {}".format(i)), on_error=lambda e: print("on_error: {}".format(e)), on_completed=lambda: print("on_completed"))