Skip to content

Commit cb77fc9

Browse files
docs: add updateState to docs
1 parent 819ee18 commit cb77fc9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,15 @@ export const FlightStore = signalStore(
6767
);
6868
```
6969

70+
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`:
71+
72+
```typescript
73+
patchState(this.store, {loading: false});
74+
75+
// updateState is a wrapper around patchState and has an action name as second parameter
76+
updateState(this.store 'update loading', {loading: false});
77+
```
78+
7079
## Redux: `withRedux()`
7180

7281
`withRedux()` bring back the Redux pattern into the Signal Store.

0 commit comments

Comments
 (0)