本文整理汇总了Python中rx.core.Observable.combine_latest方法的典型用法代码示例。如果您正苦于以下问题:Python Observable.combine_latest方法的具体用法?Python Observable.combine_latest怎么用?Python Observable.combine_latest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rx.core.Observable
的用法示例。
在下文中一共展示了Observable.combine_latest方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: combine_latest
# 需要导入模块: from rx.core import Observable [as 别名]
# 或者: from rx.core.Observable import combine_latest [as 别名]
def combine_latest(self, *args):
"""Merges the specified observable sequences into one observable
sequence by using the selector function whenever any of the
observable sequences produces an element. This can be in the form of
an argument list of observables or an array.
1 - obs = observable.combine_latest(obs1, obs2, obs3,
lambda o1, o2, o3: o1 + o2 + o3)
2 - obs = observable.combine_latest([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.combine_latest(*args)