本文整理汇总了Python中rx.observable.Observable.with_latest_from方法的典型用法代码示例。如果您正苦于以下问题:Python Observable.with_latest_from方法的具体用法?Python Observable.with_latest_from怎么用?Python Observable.with_latest_from使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rx.observable.Observable
的用法示例。
在下文中一共展示了Observable.with_latest_from方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: with_latest_from
# 需要导入模块: from rx.observable import Observable [as 别名]
# 或者: from rx.observable.Observable import with_latest_from [as 别名]
def with_latest_from(self, *args):
"""Merges the specified observable sequences into one observable sequence
by using the selector function only when the source observable sequence
(the instance) produces an element. The other observables can be passed
either as seperate arguments or as a list.
1 - obs = observable.with_latest_from(obs1, obs2, obs3,
lambda o1, o2, o3: o1 + o2 + o3)
2 - obs = observable.with_latest_from([obs1, obs2, obs3],
lambda o1, o2, o3: o1 + o2 + o3)
Returns an observable sequence containing the result of combining
elements of the sources using the specified result selector function.
"""
args = list(args)
if args and isinstance(args[0], list):
args = args[0]
args.insert(0, self)
return Observable.with_latest_from(*args)