Skip to content

Commit 15a0f04

Browse files
committed
Update Readme
1 parent f08f3e1 commit 15a0f04

File tree

1 file changed

+32
-5
lines changed

1 file changed

+32
-5
lines changed

README.md

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,16 @@ There are two possibilities to update the state in the store:
132132

133133
```ts
134134
// replace a root-level property of the state with a new value
135-
this.todoStore.updateProperty('todos', ['my first todo']);
135+
this.todoStore.updateProperty('todos', ['my first todo'], 'add todo');
136136

137137
// update the whole state at once
138-
this.todoStore.update(state => {
139-
return {
138+
this.todoStore.update(
139+
state => ({
140140
...state,
141141
todos: [...state.todos, 'my first todo'],
142-
};
143-
});
142+
}),
143+
'add todo'
144+
);
144145
```
145146

146147
In combination with the `snapshot` functionality it would also be possible to update the state like this:
@@ -161,3 +162,29 @@ When a store service is not needed anymore it can be destroyed by calling the `d
161162
// store is not triggering events
162163
this.todoStore.destroy();
163164
```
165+
166+
### Usage of Redux Devtools
167+
168+
To use the dev tools it is necessary to import the dev tools module:
169+
170+
```ts
171+
import { StateDevToolsModule } from 'angular-reactive-state/dev-tools';
172+
173+
@Component({
174+
...
175+
imports: [StateDevToolsModule],
176+
standalone: true,
177+
})
178+
export class AppComponent { ... }
179+
```
180+
181+
or when there's a module
182+
183+
```ts
184+
import { StateDevToolsModule } from 'angular-reactive-state/dev-tools';
185+
186+
@NgModule({
187+
imports: [StateDevToolsModule],
188+
})
189+
export class AppModule {}
190+
```

0 commit comments

Comments
 (0)