You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/with-devtools.md
+33-16Lines changed: 33 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,9 +25,9 @@ The extensions don't activate during app initialization (as it is with `@ngrx/st
25
25
26
26
<imgsrc="../img/devtools.png"width="1000" />
27
27
28
-
## `updateState` vs `patchState`
28
+
## `updateState()` vs `patchState()`
29
29
30
-
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". If you want to customize the action name for better clarity, you can use the `updateState` function instead of `patchState`:
30
+
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". If you want to customize the action name for better clarity, you can use the `updateState()` function instead of `patchState()`:
If multiple instances of a given SignalStore exist, the Devtools will index the names. For example, if you have two `TodoDetail` instances with the name `todo-detail`, the first one will be named `todo-detail` and the second one `todo-detail-1`.
42
42
43
-
At any time, you can use `renameDevtoolsName` to change the name of the store in the Devtools.
43
+
At any time, you can use `renameDevtoolsName()` to change the name of the store in the Devtools.
44
44
45
45
The following example shows a component, which has a locally provided store and renames it according to the `id` of the `todo` Signal.
46
46
@@ -90,15 +90,15 @@ store.increase(); // would show up in the DevTools with value 2
90
90
store.increase(); // would show up in the DevTools with value 3
91
91
```
92
92
93
-
Without `withGlitchTracking`, the DevTools would only show the final value of 3.
93
+
Without `withGlitchTracking()`, the DevTools would only show the final value of 3.
94
94
95
-
It is also possible to mix. So one store could have `withGlitchTracking` and another one not.
95
+
It is also possible to mix. So one store could have `withGlitchTracking()` and another one not.
96
96
97
97
## `withDisabledNameIndices()`
98
98
99
-
`withDevtools` foresees the possibility to add features which extend or modify it. At the moment, `withDisabledNameIndices` is the only feature available. It disables the automatic indexing of the store names in the Devtools.
99
+
`withDevtools()` foresees the possibility to add features which extend or modify it. At the moment, `withDisabledNameIndices()` is the only feature available. It disables the automatic indexing of the store names in the Devtools.
100
100
101
-
If multiple instances exist at the same time, `withDisabledNameIndices` will throw an error. This is useful if you want to ensure that only one instance of a store is active at a time or that the store name is unique.
101
+
If multiple instances exist at the same time, `withDisabledNameIndices()` will throw an error. This is useful if you want to ensure that only one instance of a store is active at a time or that the store name is unique.
`withMapper` allows you to define a function that maps the state before it is sent to the Devtools.
111
+
`withMapper()` allows you to define a function that maps the state before it is sent to the Devtools.
112
112
113
113
Sometimes, it is necessary to map the state before it is sent to the Devtools. For example, you might want to exclude some properties, like passwords or other sensitive data.
`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.
120
135
121
-
Itisrequiredtoaddthe`withDevtools`function to the environment files.
136
+
It is required to add the `withDevtools()` function to the environment files.
122
137
123
138
environments/environment.ts:
124
139
@@ -128,7 +143,7 @@ import { withDevtools } from '@angular-architects/ngrx-toolkit';
0 commit comments