Router Component Store

screenshot of Router Component Store
angular

Strictly typed lightweight alternatives to NgRx Router Store and ActivatedRoute.

Overview

The ngworkers Router Store is an exciting solution for Angular developers looking to manage router state effectively. It introduces two main packages—@ngworker/router-component-store and @ngworker/router-signal-store—which offer strictly typed, lightweight alternatives to the traditional NgRx Router Store. These packages cater to different reactive programming preferences, whether you lean towards the observable paradigm with the Component Store or the signal-based approach with Angular Signals.

Both packages are designed with a focus on simplicity and efficiency, ensuring that developers can easily integrate them into existing Angular projects. With their minimal bundle size and robust TypeScript support, they are perfect for anyone looking to streamline state management while maintaining a clear and structured codebase.

Features

  • Strictly Typed: Enjoy full TypeScript support with strict typing for improved development experience and reduced runtime errors.
  • Lightweight: Both packages have a minimal impact on your bundle size, ensuring fast load times for your application.
  • Drop-in Replacement: Designed to seamlessly replace NgRx Router Store and ActivatedRoute, making migration straightforward.
  • Global & Local Stores: Support for both application-wide and component-specific router state management, providing flexibility in usage.
  • Immutable State: Maintain immutability and serializability of router state, which simplifies debugging and enhances application stability.
  • Memory Safe: Advanced subscription management ensures proper cleanup, avoiding memory leaks and optimizing performance.
  • Compatibility: Developed in accordance with Angular's release pattern for libraries, ensuring smooth integration and functionality with different Angular and NgRx versions.
angular
Angular

Angular is a TypeScript-based open-source framework by Google for building dynamic single-page applications and cross-platform mobile apps with MVC architecture and a rich set of features.

eslint
Eslint

ESLint is a linter for JavaScript that analyzes code to detect and report on potential problems and errors, as well as enforce consistent code style and best practices, helping developers to write cleaner, more maintainable code.

postcss
Postcss

PostCSS is a popular open-source tool that enables web developers to transform CSS styles with JavaScript plugins. It allows for efficient processing of CSS styles, from applying vendor prefixes to improving browser compatibility, ultimately resulting in cleaner, faster, and more maintainable code.

typescript
Typescript

TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.