Skip to content

Commit

Permalink
docs: add updateState to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rainerhahnekamp committed Aug 6, 2024
1 parent 819ee18 commit cb77fc9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ export const FlightStore = signalStore(
);
```

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`:

```typescript
patchState(this.store, {loading: false});

// updateState is a wrapper around patchState and has an action name as second parameter
updateState(this.store 'update loading', {loading: false});
```

## Redux: `withRedux()`

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

0 comments on commit cb77fc9

Please sign in to comment.