Skip to content

Commit 8af7707

Browse files
docs: improve docs for withDevtools
1 parent 53ed7c6 commit 8af7707

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

README.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ npm i @angular-architects/ngrx-toolkit
5555

5656
## Devtools: `withDevtools()`
5757

58-
This extension is very easy to use. Just add it to a `signalStore`. Example:
58+
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).
59+
60+
To use the Devtools, you need to add the `withDevtools()` extension to your SignalStore:
5961

6062
```typescript
6163
export const FlightStore = signalStore(
@@ -66,6 +68,16 @@ export const FlightStore = signalStore(
6668
);
6769
```
6870

71+
After that, open your app and navigate to the component that uses the store. Open the Devtools and you will see the `flights` store in the Devtools under the name "NgRx Signal Store"
72+
73+
You can find a working example in the [demo app](https://github.com/angular-architects/ngrx-toolkit/blob/main/apps/demo/src/app/todo-store.ts).
74+
75+
**Important**: The extensions don't activate them during app initialization (as it is with `@ngrx/store`). You need to open the Devtools and select the "NgRx Signal Store" tab to activate it.
76+
77+
<img src="https://raw.githubusercontent.com/angular-architects/ngrx-toolkit/main/devtools.png" width="1000">
78+
79+
---
80+
6981
The Signal Store does not use the Redux pattern, so there are no action names involved by default. Instead, every action is referred to as a "Store Update". However, if you want to customize the action name for better clarity, you can use the `updateState` method instead of `patchState`:
7082

7183
```typescript

0 commit comments

Comments
 (0)