[英]Why can't I see the initialvalues from NGRX when subscribing to my selector observable?
I have a NGRX application and I can't see it working with the selector.我有一个 NGRX 应用程序,但我看不到它与选择器一起工作。 It doesn't show the initialvalues I put in the reducer.
它没有显示我放入减速器的初始值。 It only shows value after I dispatch an Action.
它仅在我发送 Action 后才显示价值。 Why I can't see the initialValue from the observable?
为什么我看不到 observable 中的 initialValue?
Here is the code:这是代码:
exportLoading$ = this._store.pipe(select(selectImbalanceDetailsExportLoading));
ngOnInit(): void {
exportLoading$.subscribe(x=> console.log(x));
}
Would be nice to see how you init the state, might you share it?很高兴看到你如何初始化 state,你能分享一下吗?
Also people say the next possible reasons:人们还说下一个可能的原因:
the reducer of the missing property had no default case for the actions, so it was returning undefined And for the empty object, I think it is just store-devtools that hide property with undefined value.
缺少属性的减速器没有默认情况下的动作,所以它返回未定义对于空的 object,我认为只是 store-devtools 隐藏了具有未定义值的属性。
Info is taken from here: https://github.com/ngrx/platform/issues/1086#issuecomment-391373866信息取自这里: https://github.com/ngrx/platform/issues/1086#issuecomment-391373866
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.