首页 > 解决方案 > NGXS state size and performance

问题描述

I'm impressed with the redux-like pattern in Angular, and I'm hooked into NGXS (I compared this with NGRX and Akita, but opted for NGXS).

I'm aware that NGXS stores all the previous states within the application, so if I've a very complex UI, with tons of grid manipulations, etc which on each action adds a new state, won't the global state object becomes 'very large' and bulky with the entire hierarchy of the previous states ?

Is there a performance issue with this as the application gets complex and complex ?

标签: reduxangular6ngxs

解决方案


NGXS 不存储应用程序以前的状态。当您添加开发工具插件并打开 Redux 开发工具时,每个状态更改都会发送到 Redux 开发工具。它将是存储先前应用程序状态的开发工具。

随着应用程序状态树变得越来越大,您会看到的唯一性能损失是在您打开 Redux 开发工具时。除此之外,它完全取决于您如何设计状态和选择器。


推荐阅读