HeadlinesBriefing favicon HeadlinesBriefing.com

NgRx Toolkit v21 Improves Error Handling, DevTools

DEV Community •
×

NgRx Toolkit v21 arrives with refined error handling for withResource() and withEntityResources(), offering 'native', 'undefined value', or 'previous value' strategies. This addresses deadlock scenarios where resource errors conflict with state updates. The toolkit, born from community requests, provides essential extensions like withStorageSync() and withDevtools() for Angular SignalStore, building on features incubated in earlier versions.

A key addition is withTrackedReducer(), which finally integrates official NgRx Events into Redux DevTools via withGlitchTracking(). This resolves a compatibility gap, allowing event-driven state changes to be visualized. The update also deprecates `store.clearStack` in favor of clearUndoRedo(), providing a configurable soft reset. These changes follow v20's introduction of withResource() and the Mutations API, inspired by Angular Query.

Looking ahead, the team commits to smoother compatibility with future Angular and NgRx majors. An external tool, ngrx-toolkit-openapi-gen, now generates complete Signal Stores with Resources and Mutations from OpenAPI specs, highlighting the ecosystem's growth. The update reflects ongoing community collaboration, with contributions from developers like mzkmnk and Gregor Woiwode, solidifying the toolkit's role in streamlining Angular state management.