Skip to content

Commit 439a828

Browse files
BorodinDKtimdorr
authored andcommitted
Returning a new state (#3002)
I think that writing `newState` in this case is more correct. I propose to make it similar to this text https://github.com/reduxjs/redux/blame/master/docs/faq/Actions.md#L61
1 parent 5185753 commit 439a828

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/recipes/ReducingBoilerplate.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -528,4 +528,4 @@ function createReducer(initialState, handlers) {
528528

529529
This wasn't difficult, was it? Redux doesn't provide such a helper function by default because there are many ways to write it. Maybe you want it to automatically convert plain JS objects to Immutable objects to hydrate the server state. Maybe you want to merge the returned state with the current state. There may be different approaches to a “catch all” handler. All of this depends on the conventions you choose for your team on a specific project.
530530

531-
The Redux reducer API is `(state, action) => state`, but how you create those reducers is up to you.
531+
The Redux reducer API is `(state, action) => newState`, but how you create those reducers is up to you.

0 commit comments

Comments
 (0)