【发布时间】:2016-06-30 01:20:32
【问题描述】:
我正在使用 ngrx/store。
this.store
.select(s => s.products && s.products.name)
.filter(name => !!name)
.subscribe(name => {
// Now if there is a `name` in the store, it will run immediately
// However, I want to get the `name`, only if a new value comes after subscribing
console.log(name);
});
我尝试在.subscribe 之前添加.publish(),但我无法获得任何值。
我如何才能获得name,只有在订阅后出现新值?谢谢
【问题讨论】:
标签: angular typescript rxjs ngrx