You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Middlewares.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
1
# Middlewares
2
-
Middlewares are used when you want to do anything more than just change the state. It can be used to dispatch asynchronous actions for e.g. to load external data or perform a *side-effect* in the application.
2
+
3
+
Middlewares are used when you want to do anything more than just change the state. It can be used to dispatch asynchronous actions for e.g. to load external data or perform a side-effect in the application.
3
4
4
5
```js
5
6
constAPI_REQUEST='mymodule/REQUEST'
@@ -17,7 +18,7 @@ const mymodule = {
17
18
}
18
19
```
19
20
20
-
Just like you can do with reducers, you can also use an object for the middlewares when you want to listen to a single or multiple action types.
21
+
Just like you can do with reducers, you can also use an object for middlewares, when you want to listen to a single or multiple action types:
21
22
22
23
```js
23
24
constAPI_REQUEST='mymodule/REQUEST'
@@ -31,6 +32,6 @@ const mymodule = {
31
32
}
32
33
```
33
34
34
-
In middlewares you can dispatch an action using `next()` or `dispatch()`, see the [Side Effects](SideEffects.md)docs for better understanding on why and how to use them.
35
+
Inside middlewares you can dispatch an action using `next()` or `dispatch()`, see the [Side Effects](SideEffects.md)documentation for better understanding on when and how to use them.
35
36
36
-
You can check Redux documentation for a more detailed documentation about Redux's[reducers](http://redux.js.org/docs/basics/Reducers.html) and[middlewares](http://redux.js.org/docs/advanced/Middleware.html).
37
+
You can check Redux's documentation for a more detailed documentation about Redux's [middlewares](http://redux.js.org/docs/advanced/Middleware.html).
0 commit comments