简体   繁体   English

ngrx 实体为什么订单很重要

[英]ngrx entity why order matters

Currently I'm studying ngrx entity and I read in this blog post, that with this feature, we basically say, that our entities are like database tables.目前我正在研究 ngrx 实体,我在这篇博文中读到,有了这个特性,我们基本上可以说,我们的实体就像数据库表。 But I don't unterstand one thing.但我不明白一件事。 Why is there a focus on the order in the collections?为什么重点放在collections的顺序上? Because if I have a database, I don't care about the order in the table, I just select the data in the order I want it.因为如果我有一个数据库,我不关心表中的顺序,我只是按照我想要的顺序 select 数据。 And that could be maybe done the ngrx way via selectors too.这也可以通过选择器以 ngrx 方式完成。

You're right.你是对的。 The order is of no importance for entities.该顺序对于实体并不重要。 If you want to sort results, this can better be done in the selector (or component).如果你想对结果进行排序,最好在选择器(或组件)中完成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM