【发布时间】:2018-05-26 22:14:09
【问题描述】:
假设我有两个 observables。
第一个 observable 是某些列表的数组:
[
{id: 'zzz', other props here...},
{id: 'aaa', ...},
{id: '007', ...}
... and more over time
]
第二个 observable 是一个忽略列表的数组:
[
{id: '007'}, // only id, no other props
{id: 'zzz'}
... and more over time
]
结果应该是一个新的 observable 列表(第一个 observable),但不能有任何被忽略的列表:
[
{id: 'aaa', other props here...}
... and more over time
]
这是我现在发布之前的内容:
obs2.pipe(withLatestFrom(obs1, ? => ?, filter(?));
【问题讨论】:
-
如果列表是在第一个 observable 上发出的,然后在第二个 observable 上作为被忽略的发出?你能保证这不会发生吗?
-
另外,由于您显然需要缓冲第二个 observable,您希望该缓冲区永远存在(并增长)还是有某种条件可以再次删除它们(即,任何列表只能出现在第一个可观察的一次,基于时间,..)?
标签: javascript angular firebase rxjs angular6