The last notable release is the
first beta of NGRX 10. This beta includes a few bug fixes and, more importantly, two new modules: component and component-store. The new component module aims to help us create more efficient Angular components, ideally letting us get rid of Zone.js and thus creating so-called “zone-less” applications. Component includes the
*ngrxLet directive and the
ngrxPush pipe. The former provides a way to find observables to a view context (i.e., a DOM element scope); it allows to track the observables next/error values and complete state and handles change detection nicely, whether zone.js is there or not. The ngrxPush pipe is a drop-in replacement for the async pipe, but again, better handling change detection and supporting a zone-less mode. I didn’t dive in detail into the component module just yet, but plan on writing a small article about it in the coming weeks. I did dive into the other new module: component-store, which I find really interesting and well worth learning about. Component-store is going to help us better deal with complex Angular components by letting us extract component-specific state and business-logic (and thus complexity) out of the components. By creating so-called component-stores, we will also be able to reuse complex components (which is hard to do otherwise) and even share those across applications. In addition, it’ll allow us to avoid polluting the global NGRX store with state that doesn’t really belong into it. I wrote
two articles about NGRX component-store:
Comments ()