Skip to content

Commit 9de7445

Browse files
committed
Typos and clarficiation
1 parent 1f19428 commit 9de7445

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

docs/types-and-terminology.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Types and terminology
22
=====================
33

4-
This is a glossary of the core terms in Redux, along with their type signatures. Types documented using [Flow notation](http://flowtype.org/docs/quick-reference.html#_).
4+
This is a glossary of the core terms in Redux, along with their type signatures. Types are documented using [Flow notation](http://flowtype.org/docs/quick-reference.html#_).
55

66
### State
77

@@ -57,12 +57,12 @@ An action creator is, quite simply, a function that creates an action. Do not co
5757
type IntermediateAction = any
5858
```
5959

60-
An *intermediate action* is a value that is sent to a dispatching function, but is not yet ready for consumption by the reducer; it will be transformed by middleware before being sent to the base `dispatch()` function. Intermediate actions are often asynchronous primitives, like a promise or a thunk, which are not dispatched themselves, but trigger dispatches once an operation has completed.
60+
An **intermediate action** is a value that is sent to a dispatching function, but is not yet ready for consumption by the reducer; it will be transformed by middleware before being sent to the base `dispatch()` function. Intermediate actions are often asynchronous primitives, like a promise or a thunk, which are not dispatched themselves, but trigger dispatches once an operation has completed.
6161

6262
### Middleware
6363

6464
```js
65-
type Middleware = ({ dispatch: Dispatch, getState: () => State }) => next: Dispatch => Dispatch
65+
type Middleware = ({ dispatch: Dispatch, getState: () => State }) => (next: Dispatch) => Dispatch
6666
```
6767

6868
A middleware is a higher-order function that composes a dispatch function to return a new dispatch function.
@@ -79,7 +79,7 @@ Middleware is composable using function composition.
7979
type Store = { dispatch: Dispatch, getState: State, subscribe: Function, getReducer: Reducer, replaceReducer: void }
8080
```
8181

82-
Store is an object of bound methods to an underlying class instance.
82+
A store is an object of bound methods to an underlying class instance.
8383

8484
- `dispatch()` is the base dispatch function described above.
8585
- `getState()` returns the current state of the store.
@@ -101,3 +101,7 @@ type HigherOrderStore = CreateStore
101101
```
102102

103103
A higher-order store is a higher-order function that composes a store-creating function to return a new store-creating function. This is similar to middleware in that it allows you to alter the store interface in a composable way.
104+
105+
Higher-order stores are much the same concept as higher-order components in React.
106+
107+
Because a store is not an instance, but rather an plain-object collection of bound methods, copies can be easily created and modified without mutating the original store.

0 commit comments

Comments
 (0)