Skip to content

Commit 7bf37a9

Browse files
committed
docs(devtools): add section for withTrackedReducer
1 parent 05a5ad5 commit 7bf37a9

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

docs/docs/with-devtools.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ title: withDevtools()
66
import { withDevtools } from '@angular-architects/ngrx-toolkit';
77
```
88

9+
<!-- TODO - add backported version -->
10+
11+
:::info
12+
Devtools integration with `@ngrx/signals/events` is now available starting in version 20.TODO
13+
:::
14+
915
Redux Devtools is a powerful browser extension tool, that allows you to inspect every change in your stores. Originally, it was designed for Redux, but it can also be used with the SignalStore. You can download it for Chrome [here](https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd).
1016

1117
To use the Devtools, you need to add the `withDevtools()` extension to your SignalStore:
@@ -165,6 +171,24 @@ const Store = signalStore(
165171
);
166172
```
167173

174+
## Events tracking: `withTrackedReducer`
175+
176+
`withTrackedReducer` tracks state changes within the events
177+
plugin. This utility automatically derives the event name, streamlining
178+
the tracking process.
179+
180+
To use it
181+
182+
1. _Replace usages of `withReducer` with `withTrackedReducer`_. Note: native `withReducer` support is planned for the future, but that requires upstream support from `@ngrx/signals`.
183+
2. _[`withGlitchTracking`](#withglitchtracking) must be specified within `withDevtools`_. If `withTrackedReducer` is used without the devtools and glitch tracking, runtime errors will be thrown.
184+
185+
```ts
186+
// Must have all three, or runtime errors for thee!
187+
import { withTrackedReducer, withGlitchTracking, withDevtools } from '@angular-architects/ngrx-toolkit';
188+
189+
const Store = signalStore({ providedIn: 'root' }, withDevtools('store', withGlitchTracking()), withTrackedReducer());
190+
```
191+
168192
## Disabling Devtools in production
169193

170194
`withDevtools()` is by default enabled in production mode, if you want to tree-shake it from the application bundle you need to abstract it in your environment file.

0 commit comments

Comments
 (0)