我有一个简单的视图
mapply(function(x, y){cat("x = ", x, " y = ", y, "\n")},
x = 1:5, y = 1:3)
x = 1 y = 1
x = 2 y = 2
x = 3 y = 3
x = 4 y = 1
x = 5 y = 2
<div *ngIf = "user$ | async as user ">
<app-user-portfolio-edit [user]="user"></app-user-portfolio-edit>
</div>
来自
user$
当我调度一个动作并更新this.user$ = this.store.select( state => {
const userToEdit = state.user.userToEdit;
console.log('selecting user ', userToEdit);
return userToEdit;
});
时,我看到userToEdit
调用被触发,并且正在返回一个新用户。
但是我的组件没有获得新用户。我有一个属性设置器来侦听更改,该更改在第一次调用后就不会触发。