Skip to content

Live NgRx Signal Store inspector #34

Description

@erkamyaman

Today the store scanner finds signalStore, signalState and signalMethod declarations in source, and the Runtime tab only shows the classic Store. Signal Store state isn't visible live.

Scope

  • Store instances. List every live Signal Store instance: where it's provided (root, route, component) and which component injected it.
  • State. Current state through getState(store), updated live. Every change recorded with watchState, which also catches updates made in the same tick, with a timeline and diff per change.
  • Store members. Computed values with their current value, methods, and rxMethod / signalMethod calls with arguments and timing.
  • Entities. For withEntities: ids, count, and the selected entity.
  • Events plugin. For @ngrx/signals/events: dispatched events, which withReducer case handled each one, and the resulting state change.
  • MCP tools: inspect-signal-store (state, members, where it's provided) and signal-store-history (changes and events).

Later

  • Edit state from the panel with patchState (dev only).
  • Time travel: jump to an earlier state from the history.

Notes

  • Stores whose state is protected (the default) still allow getState and watchState from outside, so no app changes should be needed.
  • Look at withDevtools() in @angular-architects/ngrx-toolkit for how others record Signal Store changes. The goal here is to need no extra feature in the store.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions