CoreGamix — Full-Stack Engineering & Developer ToolsCoreGamix — Full-Stack Engineering & Developer Tools
  • Angular
  • Web Development
    • React & TypeScript
    • Node.js
    • PHP & MySQL
  • Tech & AI News
  • Tools & Plugins
  • About
  • Contact Us
HomeWeb Development Angular NgRx Store vs SignalStore in Angular: Migration Guide & When to Use Each

NgRx Store vs SignalStore in Angular: Migration Guide & When to Use Each

Anil Mehra on November 28, 2026
Angular Frontend Development Web Development
NgRx Store vs SignalStore architecture comparison in Angular
9 Min Read

Choosing between NgRx Store vs SignalStore is one of the highest-impact architecture decisions in modern Angular, because state choices shape every feature you ship. For example, in a classic Redux setup, adding a single paginated table with a status filter still touches five separate files—actions.ts, reducer.ts, effects.ts, selectors.ts, and a component.

When the NgRx team released @ngrx/signals (documented in the official NgRx SignalStore documentation), many Angular teams assumed it was a drop-in replacement for global @ngrx/store. However, ripping out a working global store often creates worse coupling than the boilerplate it removes, especially when decoupled modules rely on shared event streams.

This guide breaks down NgRx Store vs SignalStore using real production code, and it also walks through an incremental migration pattern where both coexist cleanly in a zoneless Angular application.

NgRx Store vs SignalStore: Event Bus vs. Direct Signals

First, before comparing line counts, look at how data moves through each library:

  • NgRx Store (@ngrx/store + @ngrx/effects) acts as an event bus with immutable reducers, so components never mutate state directly. Instead, they dispatch an action (OrdersActions.cancelOrder), and any number of reducers or effects across the app can react without knowing about each other.
  • NgRx SignalStore (@ngrx/signals), on the other hand, is a composable state container built directly on primitives from the Angular Signals guide. You call methods directly on the store (ordersStore.cancelOrder(orderId)), update state via patchState(), and read fine-grained Signal values in templates.

NgRx Store vs SignalStore Decision Matrix

Before refactoring existing slices, evaluate NgRx Store vs SignalStore across lifecycle scope, bundle weight, and cross-module fan-out:

CriteriaClassic NgRx Store (@ngrx/store)NgRx SignalStore (@ngrx/signals)
Primary Mental ModelIndirect: Action → Effect / Reducer → SelectorDirect: Store Method → patchState → Signal
File Footprint per Feature3–5 files (actions, reducer/feature, effects, models)1 self-contained store file (+ optional custom features)
Lifecycle ScopeGlobal singleton (+ lazy feature slices that stay in memory)Flexible: global (providedIn: 'root'), route, or component
Cross-Module Fan-OutExcellent (1 action like AuthActions.Logout resets 10 slices)Manual (requires injecting stores or listening to shared streams)
Bundle Size ImpactHigher (@ngrx/store + @ngrx/effects)Lightweight (~2–4 kB min+gzip on top of Angular Signals)
Redux DevTools SupportBuilt-in via @ngrx/store-devtoolsSupported via withDevtools() from ngrx-toolkit
Zoneless & SSR ReadinessSupported via store.selectSignal()100% native Angular Signals from the ground up

Side-by-Side Code: Order Fulfillment Feature

To keep the comparison fair, let’s use modern NgRx APIs on both sides rather than verbose 2019 switch-case reducers. Even so, with createActionGroup and createFeature (covered in our NgRx setup guide for Angular), plenty of ceremony remains for a filtered order list.

1. Classic NgRx Store Implementation

// orders.models.ts
export type OrderStatus = 'pending' | 'shipped' | 'cancelled';

export interface Order {
  id: string;
  customerEmail: string;
  totalCents: number;
  status: OrderStatus;
}

// orders.actions.ts
import { createActionGroup, props } from '@ngrx/store';
import { Order, OrderStatus } from './orders.models';

export const OrdersActions = createActionGroup({
  source: 'Orders Page',
  events: {
    'Load Orders': props<{ statusFilter: OrderStatus | 'all' }>(),
    'Load Orders Success': props<{ orders: Order[] }>(),
    'Load Orders Failure': props<{ error: string }>(),
    'Cancel Order': props<{ orderId: string }>(),
    'Cancel Order Success': props<{ updated: Order }>(),
    'Cancel Order Failure': props<{ error: string }>(),
  },
});

// orders.feature.ts
import { createFeature, createReducer, createSelector, on } from '@ngrx/store';
import { OrdersActions } from './orders.actions';
import { Order, OrderStatus } from './orders.models';

interface OrdersState {
  orders: Order[];
  statusFilter: OrderStatus | 'all';
  loading: boolean;
  savingOrderId: string | null;
  error: string | null;
}

const initialState: OrdersState = {
  orders: [],
  statusFilter: 'all',
  loading: false,
  savingOrderId: null,
  error: null,
};

export const ordersFeature = createFeature({
  name: 'orders',
  reducer: createReducer(
    initialState,
    on(OrdersActions.loadOrders, (state, { statusFilter }) => ({
      ...state,
      statusFilter,
      loading: true,
      error: null,
    })),
    on(OrdersActions.loadOrdersSuccess, (state, { orders }) => ({
      ...state,
      orders,
      loading: false,
    })),
    on(OrdersActions.loadOrdersFailure, (state, { error }) => ({
      ...state,
      loading: false,
      error,
    })),
    on(OrdersActions.cancelOrder, (state, { orderId }) => ({
      ...state,
      savingOrderId: orderId,
    })),
    on(OrdersActions.cancelOrderSuccess, (state, { updated }) => ({
      ...state,
      savingOrderId: null,
      orders: state.orders.map((o) => (o.id === updated.id ? updated : o)),
    })),
    on(OrdersActions.cancelOrderFailure, (state, { error }) => ({
      ...state,
      savingOrderId: null,
      error,
    }))
  ),
  extraSelectors: ({ selectOrders }) => ({
    selectPendingRevenueCents: createSelector(selectOrders, (orders) =>
      orders
        .filter((o) => o.status === 'pending')
        .reduce((sum, o) => sum + o.totalCents, 0)
    ),
  }),
});

In addition, you still need a separate orders.effects.ts class to wire HTTP calls to those six actions.

2. NgRx SignalStore Implementation (Single File)

Here is the exact same state, derived revenue calculation, race-condition-safe read stream (switchMap), and double-click-safe mutation stream (exhaustMap) inside a single OrdersStore:

// orders.store.ts
import { computed, inject } from '@angular/core';
import { HttpErrorResponse } from '@angular/common/http';
import {
  patchState,
  signalStore,
  withComputed,
  withMethods,
  withState,
} from '@ngrx/signals';
import { rxMethod } from '@ngrx/signals/rxjs-interop';
import { tapResponse } from '@ngrx/operators';
import { exhaustMap, pipe, switchMap, tap } from 'rxjs';
import { OrdersApiService } from './orders-api.service';
import { Order, OrderStatus } from './orders.models';

interface OrdersState {
  orders: Order[];
  statusFilter: OrderStatus | 'all';
  loading: boolean;
  savingOrderId: string | null;
  error: string | null;
}

const initialState: OrdersState = {
  orders: [],
  statusFilter: 'all',
  loading: false,
  savingOrderId: null,
  error: null,
};

export const OrdersStore = signalStore(
  withState(initialState),
  withComputed(({ orders }) => ({
    pendingRevenueDollars: computed(() => {
      const cents = orders()
        .filter((o) => o.status === 'pending')
        .reduce((sum, o) => sum + o.totalCents, 0);
      return cents / 100;
    }),
    hasOrders: computed(() => orders().length > 0),
  })),
  withMethods((store, api = inject(OrdersApiService)) => ({
    // switchMap cancels stale HTTP reads if the user flips filters quickly
    loadOrders: rxMethod<OrderStatus | 'all'>(
      pipe(
        tap((statusFilter) =>
          patchState(store, { statusFilter, loading: true, error: null })
        ),
        switchMap((statusFilter) =>
          api.getOrders(statusFilter).pipe(
            tapResponse({
              next: (orders) => patchState(store, { orders, loading: false }),
              error: (err: HttpErrorResponse) =>
                patchState(store, {
                  loading: false,
                  error: err.error?.message ?? 'Failed to load orders.',
                }),
            })
          )
        )
      )
    ),

    // exhaustMap ignores duplicate clicks while a cancellation is in flight
    cancelOrder: rxMethod<string>(
      pipe(
        tap((orderId) =>
          patchState(store, { savingOrderId: orderId, error: null })
        ),
        exhaustMap((orderId) =>
          api.cancelOrder(orderId).pipe(
            tapResponse({
              next: (updated) =>
                patchState(store, (state) => ({
                  savingOrderId: null,
                  orders: state.orders.map((o) =>
                    o.id === updated.id ? updated : o
                  ),
                })),
              error: (err: HttpErrorResponse) =>
                patchState(store, {
                  savingOrderId: null,
                  error: err.error?.message ?? 'Could not cancel order.',
                }),
            })
          )
        )
      )
    ),
  }))
);

Notice we omitted { providedIn: 'root' } on purpose. Because we provide OrdersStore at the route level, Angular destroys the store and frees memory automatically when the user leaves /orders:

// orders.routes.ts
import { Routes } from '@angular/router';
import { OrdersStore } from './orders.store';

export const ORDERS_ROUTES: Routes = [
  {
    path: '',
    providers: [OrdersStore],
    loadComponent: () =>
      import('./orders-page.component').then((m) => m.OrdersPageComponent),
  },
];

In the component, pass your filter signal directly into loadOrders(this.selectedFilter). As a result, rxMethod re-runs whenever that signal changes, with zero manual ngOnDestroy cleanup.

When NgRx Store Still Beats SignalStore

Do not migrate everything blindly, however. Keep global @ngrx/store whenever your domain matches one of these three patterns:

  1. First, High-Fan-Out Application Events: One action like AuthActions.SessionExpired needs to clear caches, close WebSockets, redirect routes, and reset six slices without coupling services together.
  2. Second, Strict Audit Trails & Action Replay: Regulated dashboards in fintech or healthcare often require QA to attach Redux DevTools action logs to bug reports.
  3. Third, Multi-Source Orchestration Effects: Some workflows coordinate router navigation events, WebSocket heartbeats, and optimistic rollbacks across domains using RxJS Actions streams.

On the other hand, if a page only fetches read-only data tied to route parameters, you may not need SignalStore either. Instead, Angular’s built-in resource() and httpResource() APIs (see our Angular Resource API guide) handle async reads with even less code.

Hybrid Migration: Running NgRx Store and SignalStore Together

You do not have to treat NgRx Store vs SignalStore as an all-or-nothing rewrite. Instead, the cleanest production architecture for mid-to-large Angular apps is a hybrid split:

  • Keep App-Wide Cross-Cutting State (Auth session, active tenant, permissions, global notifications) in @ngrx/store.
  • Build all Route & Feature State (tables, multi-step wizards, drawers, dashboards) in NgRx SignalStore.

Bridging the two takes just three lines of code with store.selectSignal() inside SignalStore:

// Bridging Global NgRx Store into a Route-Scoped SignalStore
import { computed, inject } from '@angular/core';
import { Store } from '@ngrx/store';
import { signalStore, withComputed, withHooks } from '@ngrx/signals';
import { selectCurrentTenantId } from '../auth/auth.selectors';

export const ReportsStore = signalStore(
  withComputed((_, globalStore = inject(Store)) => {
    const tenantId = globalStore.selectSignal(selectCurrentTenantId);
    return {
      tenantId,
      canExportCsv: computed(() => Boolean(tenantId())),
    };
  }),
  withHooks({
    onInit(store) {
      // Automatically reloads whenever global tenantId signal changes!
      // store.loadReportsForTenant(store.tenantId);
    },
  })
);

Because globalStore.selectSignal() returns a native Angular Signal, passing store.tenantId into an rxMethod automatically refetches feature data when the user switches tenants. In addition, pairing route-scoped SignalStores with Angular Incremental Hydration for SSR also keeps initial server payloads lean and predictable.

3 Production Pitfalls During Migration

Pitfall 1: Calling HTTP Inside effect() Instead of rxMethod()

Developers new to Signals often reach for effect() inside withHooks({ onInit }) to watch a filter signal and call http.get(). However, that pattern creates untracked subscription leaks and loses RxJS cancellation semantics, so pass the source signal straight into an rxMethod instead.

Pitfall 2: Making Every SignalStore Global with providedIn: ‘root’

Marking every feature store { providedIn: 'root' } keeps stale filter strings, page numbers, and error banners alive for the entire browser session. Unless the state genuinely spans multiple routes, register feature SignalStores in the route’s providers array.

Pitfall 3: Using switchMap for Write Mutations

Copy-pasting switchMap into a saveOrder or deleteItem rxMethod aborts in-flight HTTP POST requests on rapid clicks while the backend still commits them. Therefore, use switchMap for reads, exhaustMap for submit buttons, and concatMap when sequential order matters.

NgRx Store vs SignalStore Summary Checklist

In short, use this quick rule of thumb whenever your team debates NgRx Store vs SignalStore on a new feature ticket:

  • Starting a greenfield Angular 21/22 app? Default to NgRx SignalStore for stateful features and httpResource for pure read endpoints, unless you need cross-app action fan-out.
  • Maintaining an existing NgRx codebase? Keep Auth and shared global slices in @ngrx/store, bridge selectors with selectSignal(), and build new route-scoped features in SignalStore.
Anil Mehra on November 28, 2026 Angular Frontend Development Web Development
previous article
Next article

View comments (2)

Leave a comment Cancel reply

Your email address will not be published. Required fields are marked *

About the Author

Anil Mehra

Anil Mehra

Software Engineer · Google AI Certified

Anil Mehra is a Software Engineer specializing in Angular (NgRx, SignalStore, RxJS), React, TypeScript, Node.js, PHP, and MySQL. Holding the Google AI Professional Certificate, he bridges production web architecture with practical AI-powered workflows.

Google AI Professional Certificate official badge

Google AI Professional Certificate

Google · Coursera Credential ↗

About & Consulting · Instagram · LinkedIn

Recent Guides

  • WordPress Block Bindings API guide banner showing custom PHP sources connected to Gutenberg block editor Attributes sidebar
    Block Bindings API in WordPress Plugins: PHP Sources, Editor UI & Batched LoopsDecember 2, 2026
  • WordPress autoloaded options architecture card showing wp_options payload reduction from 1.84 MB to 186 KB and TTFB drop
    WordPress Autoloaded Options: Fix Plugin Bloat, TTFB Spikes & Cache EvictionsDecember 2, 2026
  • claude sonnet 4.5 retirement migration guide banner
    Claude Sonnet 4.5 Retirement Hits Today: How I Migrated Node.js Calls to Sonnet 5.5November 30, 2026
  • speculation rules api instant prerender LCP guide banner
    Speculation Rules API Guide: Cut Route LCP to 38ms Without Phantom AnalyticsNovember 30, 2026

Engineering Topics

  • Angular 13
  • Frontend Development 4
  • Node.js 3
  • PHP & MySQL 2
  • React & TypeScript 2
  • SEO & Performance 2
  • Tech & AI News 4
  • Web Development 21
  • Wordpress Plugins 3
CoreGamix — Full-Stack Engineering & Developer ToolsCoreGamix — Full-Stack Engineering & Developer Tools

contact

support@coregamix.com

© 2026 CoreGamix. All Rights Reserved.  |  About  |  Privacy Policy  |  Terms of Use  |  Contact

Back to top