Skip to content

Commit 173ff78

Browse files
committed
Kill the term "reducing function"
1 parent 3757120 commit 173ff78

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

docs/api/Store.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The only way to change the state inside it is to dispatch an [action](../underst
1111

1212
A store is not a class. It's just an object with a few methods on it.
1313

14-
To create a store, pass your root [reducing function](../understanding/thinking-in-redux/Glossary.md#reducer) to Redux Toolkit's [`configureStore` method](https://redux-toolkit.js.org/api/configureStore), which will set up a Redux store with a good default configuration. (Alternately, if you're not yet using Redux Toolkit, you can use the original [`createStore`](createStore.md) method, but we encourage you to [migrate your code to use Redux Toolkit](../usage/migrating-to-modern-redux.mdx) as soon as possible)
14+
To create a store, **pass your root [reducer function](../understanding/thinking-in-redux/Glossary.md#reducer) to Redux Toolkit's [`configureStore` method](https://redux-toolkit.js.org/api/configureStore)**, which will set up a Redux store with a good default configuration. (Alternately, if you're not yet using Redux Toolkit, you can use the original [`createStore`](createStore.md) method, but we encourage you to [migrate your code to use Redux Toolkit](../usage/migrating-to-modern-redux.mdx) as soon as possible)
1515

1616
## Store Methods
1717

@@ -32,7 +32,7 @@ _(any)_: The current state tree of your application.
3232

3333
Dispatches an action. This is the only way to trigger a state change.
3434

35-
The store's reducing function will be called with the current [`getState()`](#getState) result and the given `action` synchronously. Its return value will be considered the next state. It will be returned from [`getState()`](#getState) from now on, and the change listeners will immediately be notified.
35+
The store's reducer function will be called with the current [`getState()`](#getState) result and the given `action` synchronously. Its return value will be considered the next state. It will be returned from [`getState()`](#getState) from now on, and the change listeners will immediately be notified.
3636

3737
:::caution
3838

docs/api/combineReducers.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ You can control state key names by using different keys for the reducers in the
5555

5656
## Arguments
5757

58-
1. `reducers` (_Object_): An object whose values correspond to different reducing functions that need to be combined into one.
58+
1. `reducers` (_Object_): An object whose values correspond to different reducer functions that need to be combined into one.
5959

6060
```ts
6161
combineReducers({
@@ -153,6 +153,6 @@ console.log(store.getState())
153153

154154
## Tips
155155

156-
- This helper is just a convenience! You can write your own `combineReducers` that [works differently](https://github.com/redux-utilities/reduce-reducers), or even assemble the state object from the child reducers manually and write a root reducing function explicitly, like you would write any other function.
156+
- This helper is just a convenience! You can write your own `combineReducers` that [works differently](https://github.com/redux-utilities/reduce-reducers), or even assemble the state object from the child reducers manually and write a root reducer function explicitly, like you would write any other function.
157157

158158
- You may call `combineReducers` at any level of the reducer hierarchy. It doesn't have to happen at the top. In fact you may use it again to split the child reducers that get too complicated into independent grandchildren, and so on.

docs/api/createStore.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ See the [**Migrating to Modern Redux** page](../usage/migrating-to-modern-redux.
2828

2929
## Arguments
3030

31-
1. `reducer` _(Function)_: A [reducing function](../understanding/thinking-in-redux/Glossary.md#reducer) that returns the next [state tree](../understanding/thinking-in-redux/Glossary.md#state), given the current state tree and an [action](../understanding/thinking-in-redux/Glossary.md#action) to handle.
31+
1. `reducer` _(Function)_: A root [reducer function](../understanding/thinking-in-redux/Glossary.md#reducer) that returns the next [state tree](../understanding/thinking-in-redux/Glossary.md#state), given the current state tree and an [action](../understanding/thinking-in-redux/Glossary.md#action) to handle.
3232

3333
2. [`preloadedState`] _(any)_: The initial state. You may optionally specify it to hydrate the state from the server in universal apps, or to restore a previously serialized user session. If you produced `reducer` with [`combineReducers`](combineReducers.md), this must be a plain object with the same shape as the keys passed to it. Otherwise, you are free to pass anything that your `reducer` can understand.
3434

docs/introduction/GettingStarted.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ store.dispatch(decremented())
123123

124124
Instead of mutating the state directly, you specify the mutations you want to happen with plain objects called _actions_. Then you write a special function called a _reducer_ to decide how every action transforms the entire application's state.
125125

126-
In a typical Redux app, there is just a single store with a single root reducing function. As your app grows, you split the root reducer into smaller reducers independently operating on the different parts of the state tree. This is exactly like how there is just one root component in a React app, but it is composed out of many small components.
126+
In a typical Redux app, there is just a single store with a single root reducer function. As your app grows, you split the root reducer into smaller reducers independently operating on the different parts of the state tree. This is exactly like how there is just one root component in a React app, but it is composed out of many small components.
127127

128128
This architecture might seem like a lot for a counter app, but the beauty of this pattern is how well it scales to large and complex apps. It also enables very powerful developer tools, because it is possible to trace every mutation to the action that caused it. You can record user sessions and reproduce them just by replaying every action.
129129

docs/understanding/thinking-in-redux/Glossary.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ See also [async action](#async-action) below.
3737
type Reducer<S, A> = (state: S, action: A) => S
3838
```
3939

40-
A _reducer_ (also called a _reducing function_) is a function that accepts an accumulation and a value and returns a new accumulation. They are used to reduce a collection of values down to a single value.
40+
A _reducer_ is a function that accepts an accumulation and a value and returns a new accumulation. They are used to reduce a collection of values down to a single value.
4141

4242
Reducers are not unique to Redux—they are a fundamental concept in functional programming. Even most non-functional languages, like JavaScript, have a built-in API for reducing. In JavaScript, it's [`Array.prototype.reduce()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce).
4343

docs/usage/ReducingBoilerplate.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ AppDispatcher.register(function (action) {
484484
export default TodoStore
485485
```
486486

487-
With Redux, the same update logic can be described as a reducing function:
487+
With Redux, the same update logic can be described as a reducer function:
488488

489489
```js
490490
export function todos(state = [], action) {

0 commit comments

Comments
 (0)