我正在使用 ngrx/商店。
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);
});
.publish()
我之前尝试添加.subscribe
,但后来我无法获得任何价值。
name
仅当订阅后出现新值时,我怎样才能获得?谢谢